Merge branch 'develop-tfe3a' of git.mesalab.cn:tango/tfe into develop-tfe3a
This commit is contained in:
@@ -190,7 +190,7 @@ void cache_stat_init(struct cache_handle* cache)
|
||||
{
|
||||
const char* fieldstat_output="./cache.fieldstat";
|
||||
const char* app_name="tango_cache";
|
||||
const char* obj_size_bins_KB="10,100,1000,10000";
|
||||
const char* obj_size_bins_KB="0.5,0.8,0.9,0.95";
|
||||
|
||||
int value=0, i=0;
|
||||
screen_stat_handle_t fs_handle=NULL;
|
||||
@@ -238,7 +238,14 @@ void cache_stat_init(struct cache_handle* cache)
|
||||
|
||||
for(i=0;i<__CACHE_STAT_MAX;i++)
|
||||
{
|
||||
cache->fs_id[i]=FS_register(cache->fs_handle, spec[i].style, spec[i].calc_type, spec[i].name);
|
||||
if(spec[i].style==FS_STYLE_HISTOGRAM)
|
||||
{
|
||||
cache->fs_id[i]=FS_register_histogram(cache->fs_handle, spec[i].calc_type, spec[i].name,1,10*1024*1024,2);
|
||||
}
|
||||
else
|
||||
{
|
||||
cache->fs_id[i]=FS_register(cache->fs_handle, spec[i].style, spec[i].calc_type, spec[i].name);
|
||||
}
|
||||
}
|
||||
// value=cache->fs_id[STAT_CACHE_QUERY_HIT];
|
||||
// FS_set_para(cache->fs_handle, ID_INVISBLE, &value, sizeof(value));
|
||||
@@ -492,7 +499,6 @@ void cache_param_new(int idx, const struct Maat_rule_t* rule, const char* srv_de
|
||||
key_desc=cJSON_GetObjectItem(json,"cache_key");
|
||||
if(key_desc && key_desc->type==cJSON_Object)
|
||||
{
|
||||
param->key_descr.is_not_empty=1;
|
||||
qs=cJSON_GetObjectItem(key_desc,"ignore_qs");
|
||||
if(qs && qs->type==cJSON_Array)
|
||||
{
|
||||
@@ -508,8 +514,15 @@ void cache_param_new(int idx, const struct Maat_rule_t* rule, const char* srv_de
|
||||
}
|
||||
}
|
||||
item=cJSON_GetObjectItem(key_desc,"cookie");
|
||||
if(item && item->type==cJSON_String) param->key_descr.include_cookie=tfe_strdup(item->valuestring);
|
||||
|
||||
if(item && item->type==cJSON_String)
|
||||
{
|
||||
param->key_descr.include_cookie=tfe_strdup(item->valuestring);
|
||||
|
||||
}
|
||||
if(param->key_descr.qs_num>0||param->key_descr.include_cookie!=NULL)
|
||||
{
|
||||
param->key_descr.is_not_empty=1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1003,7 +1016,7 @@ enum cache_pending_result web_cache_async_pending(struct cache_handle* handle, u
|
||||
{
|
||||
_mid->cache_key=get_cache_key(request, &(param->key_descr));
|
||||
}
|
||||
TFE_LOG_DEBUG(handle->logger, "cache policy %d matched: url=%s alternative key=%s",
|
||||
TFE_LOG_DEBUG(handle->logger, "cache policy %d matched: url=%s alt-key=%s",
|
||||
cache_policy.config_id,
|
||||
request->req_spec.url,
|
||||
_mid->cache_key!=NULL?_mid->cache_key:"null");
|
||||
@@ -1199,7 +1212,7 @@ struct cache_update_context* web_cache_update_start(struct cache_handle* handle,
|
||||
case ALLOWED:
|
||||
case UNDEFINED:
|
||||
if(_mid->shall_bypass
|
||||
|| content_len > param->max_cache_obj_size
|
||||
|| (param->max_cache_obj_size!=0 && content_len > param->max_cache_obj_size)
|
||||
|| (!param->cache_cookied_cont && _mid->has_cookie)
|
||||
|| (!param->cache_html && _mid->is_html))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user