#32212: Vary header changed by SessionMiddleware
-------------------------------------+-------------------------------------
     Reporter:  y p                  |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  new
    Component:  Uncategorized        |                  Version:  2.2
     Severity:  Normal               |               Resolution:
     Keywords:  cache Vary           |             Triage Stage:
  SessionMiddleware                  |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by y p:

Old 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.

New description:

 To specify the cache mode, i use the view decorator like this:
 {{{
 @vary_on_headers('Accept', 'Accept-Language', 'Origin')
 @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#comment:1>
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/066.441675eabe7d317fb429d05395cfee52%40djangoproject.com.

Reply via email to