-Paul
Here are some tickets you might find interesting:
http://code.djangoproject.com/ticket/13217
http://code.djangoproject.com/ticket/12794
http://code.djangoproject.com/ticket/65
If you disable sessions, django will use a cookie to store the
language. If you have sessions enabled, then django checks the session
first which results in adding "Vary: Cookie" (even if it doesn't
contain any info).
I'm not an expert on caching, but even if you add a seperate cookie
for a language, but keep the sessions framework enabled, wouldn't that
still break caching ? After all the (session, language) cookie pair is
still unique and the "Vary" header doesn't let you name specific
cookies, AFAIK.
--
Łukasz Rekucki
This is proposing the same thing as #12794, but for a different reason.
#13217 is related, but the solution proposed here was not proposed there, and doesn't have the same issues that caused the WONTFIX on that ticket. This change would help that problem if the cache is able to cache by language cookie.
I'm not in favour of yet another setting if we can avoid it - we need to know if there are any downsides to always storing in the cookie rather than the session. If not, we always store in the cookie. Since we've documented the current behaviour, we may however need a deprecation path involving a setting.
This does not address the fact that accessing the session to check
causes a session to be created if it did not exist. This is what this
whole thread is about! See also the discussion on ticket #13217.
Luke
--
"I washed a sock. Then I put it in the dryer. When I took it out,
it was gone." (Steven Wright)
Luke Plant || http://lukeplant.me.uk/
Another approach is to store language in the url (useful for mobile handsets where disabled or unsupported cookies is still an issue). Django app which uses this method: https://bitbucket.org/carljm/django-localeurl
--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-developers/-/KD9VoA6u6sEJ.