Closed oppianmatt closed 10 years ago
Hi Matthew, thanks for reporting!
So the behaviour must be the following:
if settings.SOLID_I18N_USE_REDIRECTS == False
, then Vary Accept-Language header must never be set. Because in that case url without prefix will always return content in default language and url with prefix will always return content in language from that prefix. No redirects will occur.
if settings.SOLID_I18N_USE_REDIRECTS == True
, then Vary Accept-Language header must always be set for url without prefix, because from that url the redirect can occur (if request's language is not equal to default language). And for url with prefix Vary Accept-Language must never be set, because such url behaves the same as previous case, i.e. always render content with language from prefix.
Am i right?
Yep that's right. Thanks.
It would seem the point of using language urls is that you don't vary accept-languages. But if you request the default language that doesn't have a url prefix it adds the vary accept-language.
The method is:
Probably should put vary Accept-Language before the redirect (otherwise the redirect can be cached). Basically if the response is different based on the language, we need the header, if it isn't we don't. Here the redirect is different based on the request languages. But when we deliver normal page content, the pages content is not different based on language so we dont want accept-language (which will make it cache less).