#32212: Vary header changed by SessionMiddleware
-------------------------------------+-------------------------------------
Reporter: y p | Owner: nobody
Type: | Status: new
Uncategorized |
Component: | Version: 2.2
Uncategorized | Keywords: cache Vary
Severity: Normal | SessionMiddleware
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
To specify the cache mode, i use the view decorator like this:
{{{
@vary_on_headers('Accept', 'Accept-Language', 'Origin', 'User-Agent')
@cache_control(public=True, max_age=3600)
}}}
But after tracing, I found that SessionMiddleware modified the Vary Header
and added a Cookie, as follows:
{{{
if accessed:
patch_vary_headers(response, ('Cookie',))
}}}
Causes cache invalidation after user login again.
I have specified the cache as public, in which case the cache scheme
should have nothing to do with cookies.
--
Ticket URL: <https://code.djangoproject.com/ticket/32212>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.a4d2e6a6c140596c6f4b502b8ff64d09%40djangoproject.com.