我最近在Magento Turpentine的登台网站上安装了Varnish。我在0 hitrate
中收到varnishstat
。
这可能与我的页面标题有关吗?我的请求中有很多cookie。响应标头。例如,我有store
,currency
& cookielaw
个cookie,但是当我禁用生成这些的Magento模块时,只设置了典型的Magento frontend
cookie,但这没有任何区别。
Status Code:200 OK
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8
Authorization:Basic ZGV2aG9pOk5hc0RhdzEx
Cache-Control:max-age=0
Connection:keep-alive
Cookie:store=ie; adminhtml=6a879bc4bdd224727cbca06a5be87f4d; frontend=b6e7bcaa471baca15fba63417a44dad6; currency=EUR; adminhtml=6a879bc4bdd224727cbca06a5be87f4d; frontend=b6e7bcaa471baca15fba63417a44dad6; cookielaw=1
Host:staging-uat.example.com
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.95 Safari/537.36
Response Headersview source
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:close
Content-Encoding:gzip
Content-Type:text/html; charset=UTF-8
Date:Mon, 14 Sep 2015 09:39:14 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Pragma:no-cache
Server:nginx/1.4.6 (Ubuntu)
Set-Cookie:frontend=b6e7bcaa471baca15fba63417a44dad6; expires=Mon, 14-Sep-2015 10:39:13 GMT; Max-Age=3600; path=/; domain=staging.our-domain.ie
Transfer-Encoding:chunked
Vary:Accept-Encoding
X-Frame-Options:SAMEORIGIN
X-Powered-By:HHVM/3.9.0
答案 0 :(得分:1)
"在默认配置中,Varnish不会缓存来自后端的对象,并且存在Set-Cookie标头。此外,如果客户端发送Cookie标头,Varnish将绕过缓存并直接转到后端。"
请参阅:https://www.varnish-cache.org/docs/3.0/tutorial/cookies.html