Varnish and language cookie

Alessandro Ronchi alessandro.ronchi at
Sat Feb 27 17:35:53 CET 2010

2010/2/27 Cosimo Streppone <cosimo at>:

>> - cookie is removed from the browser.
> ??? This shouldn't happen at all.

I'm unable to cache content with django-language=xx cookie and return
the cached page.

I've tried all the day, but without any success.

If I unset that cookie, the backend doesn't know that language the
output is and it returns the default language.

If I leave the cookie, it doesn't cache it.

The best thing I've done is to have cached the requests without the
cookie (and language), and get the other passed.

But I think I can do that, it's a quite simple example:

- all pages are cachable and varies only with language.
- language is set in a cookie (that has to be sent to the backend if
the page is not present in cache) or with a get url (&lang=en).
- with the get url the backend sets the cookie language. so after that
other pages will be translated also without the &lang=en suffix.

- other cookies, except for google's, must send the page to pass.

Alessandro Ronchi
SOASI - Sviluppo Software e Sistemi Open Source
Hobby & Giochi, l'e-commerce del divertimento

More information about the varnish-misc mailing list