你好,对于serverfault用户,
我想请问一个人帮我configurationMgento清漆。
使用命令: varnishtop -i TxHeader -I Cookie ,以下信息显示:
TxHeader Cookie: frontend=965b5...(*lots of numbers); adminhtml=3ae65...(*lots of numbers); EXTERNAL_NO_CACHE=1
“(*很多数字)”只是我添加到信息
如何使用Varnish VCLconfiguration来删除这个cookie来caching页面?
感谢在这种情况下的任何帮助!,将不胜感激!
托马斯
根据Varnish-cache文档,你可以使用类似的东西。 我在其他网站上使用类似的设置,它就像一个魅力!
sub vcl_recv { if (req.http.cookie) { set req.http.cookie = ";" + req.http.cookie; set req.http.cookie = regsuball(req.http.cookie, "; +", ";"); set req.http.cookie = regsuball(req.http.cookie, ";(frontend|adminhtml|EXTERNAL_NO_CACHE)=", "; \1="); set req.http.cookie = regsuball(req.http.cookie, ";[^ ][^;]*", ""); set req.http.cookie = regsuball(req.http.cookie, "^[; ]+|[; ]+$", ""); if (req.http.cookie == "") { remove req.http.cookie; } } }
这听起来很像你的VCL是错误的,因为你的caching在多台计算机上不一致。
我不确定你使用的VCL是什么,但是我build议阅读这个
有Magento 1.4和Varnish 2的工作和testing的VCLs,提供你在那里看的结果