Code

Opened 3 years ago

Closed 3 years ago

#16461 closed New feature (duplicate)

Saving the user's preferred language in the session causes browser caching problems

Reported by: cnorthwood Owned by: nobody
Component: Internationalization Version: 1.3
Severity: Normal Keywords:
Cc: cnorthwood Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If the user's preferred language is saved in the session, rather than as a cookie, and if you are using page caching with Expires: headers, any pages which the user loaded before switching languages will be loaded from the browser cache, in the old language, as opposed to the newly switched to language!

If it was saved in the cookie, the Vary: Cookie header will cause the browser cache to be invalidated when the language (hence cookie) changes, but if the SessionMiddleware is being used, then it is used there. What would be nice is an option to force the locale middleware (and set_language view) to always use cookies, even if the session middleware is loaded. Perhaps even getting rid of the session storage completely - using cookies will stop gotchas like this imo!

Attachments (0)

Change History (2)

comment:1 Changed 3 years ago by cnorthwood

  • Cc cnorthwood added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 3 years ago by ramiro

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #12794.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.