Reputation: 3089
I've been thinking about setting up my (s̶t̶a̶t̶i̶c̶) news page behind the Varnishs cache since it almost never changes. However, it came to my mind that the fact that Varnish serves the exact same page for all visitors it could(?) somehow ruin Analytics and Adsense integrity. Have you guys ever faced any conflicts trying to serve Google tracked sites with Varnish? If so, what are the main problems I might have to solve?
Upvotes: 0
Views: 663
Reputation: 32760
It might be the other way round that GA ruins your caching - at least Varnish 3.0 did not cache requests with Cookie headers at all by default, and since GA uses a first party cookie there was a problem with that; you had to tell Varnish to ignore that cookie (not a problem since the GA cookie is not used on the server and only accessed by clientside code).
No personal experience with the current version, but per documentation it still does not cache requests with cookies (which makes sense since cookies might contain personal data, so caching them might not be a good idea).
Upvotes: 1