开发者

Varnish and Google Analytics

开发者 https://www.devze.com 2023-01-09 08:54 出处:网络
开发者_运维问答I don\'t quite understand how Google Analytics cookies work with Varnish. Do pages that contain GA cookie not get cached?
开发者_运维问答

I don't quite understand how Google Analytics cookies work with Varnish.

  • Do pages that contain GA cookie not get cached?
  • Do I need to remove the GA cooke in vcl_recv?
  • If I do remove them, does that stop GA tracking visitors?


Cookies invalidate the cache if the Vary header is not set. For example, a client that goes to a URL with a certain login cookie will receive a different page than a client with a different cookie.

In order to cache a page that has cookies that do not affect the cache-ability of the page (for example, Google Analytics on static sites), the cookies must be stripped or the cache won't know whether two pages should be considered the same resource.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号