On Tue, May 24, 2016 at 11:13 AM, Pinakee BIswas <[email protected]> wrote:
> Hi Per Buer, > > Thanks for the response and suggestion. I agree that caching with Cookies > is a dangerous thing as cookies are mostly user specific and caching could > leak them. > > But the challenge here is that we have few cookies which would be needed > by the backend. For example, we use a cookie which specifies the country > for the client/user. The cookie is used by the backend to figure out the > country the user is in. But then I would like to cache the pages for a > specific country. So, all the pages for users in US should be cached with a > key using the country cookie - was trying this: > The preferred way for dealing with issues like countries is to use Vary. You can have Varnish synthesize a X-Client-Country header and then have the backend issue a Vary: X-Client-Country. Then Varnish will keep different pages for different countries apart. In addition a PURGE on a URL will clean out _all_ variants of the country. If you modify the hash this becomes more complicated. As you'll have to invalidate all variants yourself. -- *Per Buer* CTO | Varnish Software AS Cell: +47 95839117 We Make Websites Fly! www.varnish-software.com <http://info.varnish-software.com/signature>
_______________________________________________ varnish-misc mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
