Changes between Initial Version and Version 1 of Ticket #15902


Ignore:
Timestamp:
Apr 26, 2011, 5:16:20 AM (13 years ago)
Author:
Luke Plant
Comment:

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.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15902

    • Property Triage Stage UnreviewedAccepted
  • Ticket #15902 – Description

    initial v1  
    55== Problem summary ==
    66
    7 {{{
    8 I'd like to make a proposal of changing the way that current language is stored, at least, making this changeable by settings.
    9 The problem is that even for non-logged users their language is stored in session (if it's supported or in the cookie otherwise).
    10 That creates a session for every client, which makes serving static (ofc I mean static, but not media) content through an upstream
    11 cache (such as Squid) really inefficient. I suppose selected language is not that secret to protect it by storing in session,
    12 and cookie is just ok. For cookie-varying cache it's a huge difference.
    13 }}}
     7The problem is that even for non-logged users their language is stored in session (if it's supported or in the cookie otherwise). That creates a session for every client, which makes serving static (ofc I mean static, but not media) content through an upstream cache (such as Squid) really inefficient. I suppose selected language is not that secret to protect it by storing in session, and cookie is just ok. For cookie-varying cache it's a huge difference.
     8
    149
    1510== Solution proposal ==
    1611
    17 {{{
    18 There is a setting named LANGUAGE_COOKIE_NAME which never gets used if
    19 you use session based cookies. The file cookie is just never saved.
    20 But if there were an option to save data in the session and also save
    21 the LANGUAGE_COOKIE as a file separately - then it would also persist
    22 after logout and solve the issue with languages after the session gets
    23 destroyed.
     12There is a setting named LANGUAGE_COOKIE_NAME which never gets used if you use session based cookies. The file cookie is just never saved. But if there were an option to save data in the session and also save the LANGUAGE_COOKIE as a file separately - then it would also persist after logout and solve the issue with languages after the session gets destroyed.
    2413
    2514(...)
    2615
    27 I would propose to have the set_language() view with options to set it
    28 as a file based cookie or a session.
     16I would propose to have the set_language() view with options to set it as a file based cookie or a session.
    2917
    3018(...)
    3119
    32 It would allow the language file based cookie to have a very long
    33 expire date and the session would still be usable for storing secure
    34 data.
    35 }}}
     20It would allow the language file based cookie to have a very long expire date and the session would still be usable for storing secure data.
Back to Top