ATS配置

来源:互联网 发布:java程序员面试秘笈 编辑:程序博客网 时间:2024/05/22 08:25

ATS默认的配置是忽略cookie,http header的,

比如用不同的cookie和Accept-Encoding: gzip, deflate都会返回同一份数据


CONFIG proxy.config.http.cache.cache_urls_that_look_dynamic INT 1
这个选项为零的话动态内容不进行缓存,直接转发


对于querystring,不同的qs都是不同的缓存


remap.config 中的regex_map只支持对host字段的匹配。。


想配置regex_remap.so 来过滤部分qs

map     http://hadoop101:8080/help/      http://10.1.72.99/help/ @plugin=regex_remap.so @pparam=/home1/hadoop/ats/etc/trafficserver/maps.reg

maps.reg中增加去除所有qs

.* http://10.1.72.99/$P

多条规则,比如只截取部分qs,其余不符合的均去除

...................

(^|&|\\?)ang639=([^&#]*)(#|&|$) http://10.1.72.99/$P?anghlq=$2

。。。。。。

.* http://10.1.72.99/$P


客户端更新缓存http头中带有Cache-Control: max-age=0

在有last-modified和etag,对于跟缓存中一致的header时会发生304访问,否则200,都会导致update hit。

CONFIG proxy.config.http.cache.ignore_client_cc_max_age INT 1           可以解决

其它相关:

CONFIG proxy.config.http.cache.ignore_client_no_cache INT 1
CONFIG proxy.config.http.cache.ims_on_client_no_cache INT 1
CONFIG proxy.config.http.cache.ignore_server_no_cache INT 0


CONFIG proxy.config.http.normalize_ae_gzip INT 1
这个选项不改的话,会导致Accept-Encoding: gzip,deflate (空,gzip都命中)和Accept-Encoding: deflate不是一份缓存


CONFIG proxy.config.http.server_ports STRING 80

CONFIG proxy.config.cache.ram_cache.size INT 8589934592

ONFIG proxy.config.url_remap.pristine_host_hdr INT 0

CONFIG proxy.config.ssl.enabled INT 0

CONFIG proxy.config.http.cache.ignore_client_cc_max_age INT 1

CONFIG proxy.config.http.normalize_ae_gzip INT 1

CONFIG proxy.config.log.squid_log_is_ascii INT 1

CONFIG proxy.config.http.negative_caching_enabled INT 1

CONFIG proxy.config.http.negative_caching_lifetime INT 60

CONFIG proxy.config.http.enable_http_stats INT 0

 





原创粉丝点击