Re: [Django] #13217: LocaleMiddleware breaks caching. (Vary: Cookie)

12 views
Skip to first unread message

Django

unread,
Jan 20, 2013, 3:15:53 PM1/20/13
to django-...@googlegroups.com
#13217: LocaleMiddleware breaks caching. (Vary: Cookie)
-------------------------------------+-------------------------------------
Reporter: harm | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 1.2-beta
Severity: Normal | Resolution: fixed
Keywords: session accessed | Triage Stage:
vary cookie | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* type: => Uncategorized
* ui_ux: => 0
* resolution: wontfix => fixed
* severity: => Normal
* easy: => 0


Comment:

If you're using `i18n_patterns` (introduced in Django 1.4) and the URL
contains a language prefix, `get_language_from_request` will select the
active language without reading the session.

So, in practice, this is fixed.

--
Ticket URL: <https://code.djangoproject.com/ticket/13217#comment:14>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 1, 2015, 3:41:16 AM10/1/15
to django-...@googlegroups.com
#13217: LocaleMiddleware breaks caching. (Vary: Cookie)
-------------------------------------+-------------------------------------
Reporter: harm | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 1.2-beta
Severity: Normal | Resolution: fixed
Keywords: session accessed | Triage Stage:
vary cookie | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by svleeuwen):

I don't think this is fixed.

For instance when using a CMS like FeinCMS you have to use LocalMiddleware
but won't use i18n_patterns.

There are likely more use cases where localisation is required but
i18n_patterns won't be used.

--
Ticket URL: <https://code.djangoproject.com/ticket/13217#comment:15>

Django

unread,
Oct 1, 2015, 8:30:10 AM10/1/15
to django-...@googlegroups.com
#13217: LocaleMiddleware breaks caching. (Vary: Cookie)
-------------------------------------+-------------------------------------
Reporter: harm | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 1.2-beta
Severity: Normal | Resolution: fixed
Keywords: session accessed | Triage Stage:
vary cookie | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timgraham):

Do you have any ideas to address the issue? I haven't taken time to
understand it but if you have a proposal, it's probably better to start a
thread on the DevelopersMailingList as discussed above rather than comment
on this old ticket which has been closed several times. Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/13217#comment:16>

Django

unread,
Jul 5, 2021, 2:08:08 PM7/5/21
to django-...@googlegroups.com
#13217: LocaleMiddleware breaks caching. (Vary: Cookie)
-------------------------------------+-------------------------------------
Reporter: harm | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 1.2-beta
Severity: Normal | Resolution: fixed
Keywords: session accessed | Triage Stage:
vary cookie | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Jerome Leclanche):

Replying to [comment:14 Aymeric Augustin]:


> If you're using `i18n_patterns` (introduced in Django 1.4) and the URL
contains a language prefix, `get_language_from_request` will select the
active language without reading the session.
>
> So, in practice, this is fixed.

@Aymeric Augustin -- I believe there's an unhandled edge case if
i18n_patterns receives ``prefix_default_language=False``: accept-language
will still be set, even though the language of the page in question is
static. I can't investigate more right now, and I know that
``prefix_default_language`` is fairly new, but leaving this here for
posterity.

--
Ticket URL: <https://code.djangoproject.com/ticket/13217#comment:17>

Reply all
Reply to author
Forward
0 new messages