Opened 4 years ago
Last modified 4 years ago
#32212 closed Uncategorized
Vary header changed by SessionMiddleware — at Initial Version
Reported by: | y p | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 2.2 |
Severity: | Normal | Keywords: | cache Vary SessionMiddleware |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
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.
Note:
See TracTickets
for help on using tickets.