In data 02 luglio 2010 alle ore 00:37:41, Laurence Rowe <[email protected]> ha
scritto:
Check that you do have the comma in Plone's caching control panel. I can
imagine it being an easy typo to make.
There are many unique variations of Accept-Language headers, so be
careful.
I've used this before in vcl_recv to normalise the incoming request:
# We only care about the language in the I18N_LANGUAGE cookie
if (req.http.Cookie ~ "(^|.*; )I18N_LANGUAGE=") {
set req.http.Accept-Language = regsub(req.http.Cookie, "(^|.*;
)I18N_LANGUAGE=([^;]*)(; .*|$)", "\2");
# XXX need to work out the proper way to match " here, e.g. "en"
set req.http.Accept-Language = regsub(req.http.Accept-Language,
"^.(.*).$", "\1");
} else {
set req.http.Accept-Language = "en";
}
This is fine, as long as you always have a cookie.
We weren't in this situation, and we wanted to honour Accept-Language
properly, so I wrote this VCL:
http://github.com/cosimo/varnish-accept-language/
--
Cosimo
_______________________________________________
varnish-misc mailing list
[email protected]
http://lists.varnish-cache.org/mailman/listinfo/varnish-misc