所以我试图在用 Silex 制作的简单测试页面中获得 Varnish“命中”。 响应具有缓存所需的 header ,但它没有被缓存。似乎是因为安装了 Google Analytics。
有没有办法告诉 Varnish(在 cloudControl 中)忽略 Google Analytics cookie?
在此处查看测试站点:http://www.delphinedhaenens.be (未命中)
更新:如果没有 Analytics 代码,缓存就会命中,所以我想 cloudControl 可能不会忽略新的 Universal Analytics cookie(“_ga”。)...cloudControl 中的人可以确认一下吗?这个?
使用 NO GA 代码查看同一网站:http://ga-delphius.cloudcontrolled.com (点击)
同样,经典 GA 代码:http://gaclassic-delphius.cloudcontrolled.com (点击)
最佳答案
Cloudcontrol routing tier (*.cloudcontrol.com) 从今天起也处理 GA 通用 cookie。请看一下简单的例子:
http://classic-gacachingtest.cloudcontrolled.com/
http://universal-gacachingtest.cloudcontrolled.com/
有什么有趣的official varnish documentation建议使用该规则,该规则将处理所有类型的 GA cookie,但也会删除其他类型的 cookie,只要它们以“_”开头,这不太酷。
关于google-analytics - cloudControl 中的 Varnish 是否忽略了新的 Google Universal Analytics cookie ("_ga")?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19981573/