我试图让ATScaching返回我的UWSGI应用程序,它当前与ATS本身运行在同一台机器上。
我不明白为什么ATS总是将我的请求转发给UWSGI,而不会caching结果。 我使用从源代码编译的ubuntu 14.04上的ATS 5.1.1,然后我在这里描述了一个教程: http : //daemonkeeper.net/735/apache-trafficserver-the-better-web-cache/
使用curl来做出一个testing请求,我总是在Via头部接收这些诊断信息: uScMsSf pSeN:t cCMi p sS
什么可以通过traffic_via解码为:
Proxy request results: Request headers received from client: simple request (not conditional) Result of Traffic Server cache lookup for URL: miss (a cache "MISS") Response information received from origin server: served Result of document write-to-cache: no cache write performed Proxy operation result: served Error codes (if any): no error Operational results: Tunnel info: no tunneling Cache-type and cache-lookup cache result values: cache / cache miss (url not in cache) ICP status: no icp Parent proxy connection status: no parent proxy Origin server connection status: connection opened successfully
有人可以帮我理解,为什么结果没有被caching?
我的remap.config:
map http://trafficserver_build:8080 http://127.0.0.1:8888
我的cache.config:
url_regex=.* revalidate=10m
我的storage.config(默认提供):
var/trafficserver 256M
日志请求状态:
/ opt / ts / bin / traffic_logcat -f /opt/ts/var/log/trafficserver/squid.blog 1415307115.252 0 10.0.3.28 TCP_MISS / 200 258 HEAD http://127.0.0.1:8888/ - DIRECT / 127.0.0.1 text / html 1415307127.721 0 10.0.3.28 TCP_MISS / 200 258 HEAD http://127.0.0.1:8888/ - DIRECT / 127.0.0.1 text / html 1415307171.141 0 10.0.3.28 TCP_MISS / 200 258 HEAD http://127.0.0.1:8888/ - DIRECT / 127.0.0.1 text / html 1415307176.480 0 10.0.3.28 TCP_MISS / 200 258 HEAD http://127.0.0.1:8888/ - DIRECT / 127.0.0.1 text / html
最可能的问题是您的来源不设置预期的HTTP标头,使响应caching。 相关的stream量服务器设置是proxy.config.http.cache.required_headers,默认情况下在响应中要求Expires或Cache-Control标头非常严格。
您还可以通过以下方式强制内容caching:
proxy.config.http.cache.required_headers设置为0 ; 和 所以例如你可以设置cache.config来包含
dest_domain=mysite.com ttl-in-cache=10m
结合0 required_headers , 即使你不控制原点 ,这也是可行的
发现了……正如James Peach所指出的,我必须允许所有请求都是可以caching的, 但是除此之外,响应必须发送Vary头 。