大文件流式缓存联调通过。UNDEFINE类型100KB以上进行缓存。

This commit is contained in:
zhengchao
2018-10-16 21:16:58 +08:00
parent 37b4f3a644
commit 1723fa1029
5 changed files with 30 additions and 6 deletions

View File

@@ -139,12 +139,28 @@ struct cache_update_context* web_cache_update_start(struct cache_handle* handle,
char buffer[TFE_STRING_MAX];
const char* value=NULL;
int i=0;
put_action=tfe_cache_put_pending(session->resp, &resp_freshness);
if(put_action!=ALLOWED)
size_t content_len=0;
if(session->resp->resp_spec.content_length!=NULL)
{
return NULL;
sscanf(session->resp->resp_spec.content_length, "%lu", &content_len);
}
put_action=tfe_cache_put_pending(session->resp, &resp_freshness);
switch(put_action){
case FORBIDDEN:
case VERIFY:
return NULL;
case ALLOWED:
break;
case UNDEFINED:
if(content_len<100*1024)
{
return NULL;
}
break;
default:
assert(0);
break;
}
struct tango_cache_meta_put meta;
memset(&meta, 0, sizeof(meta));
meta.url=session->req->req_spec.url;