#13283: CACHE_MIDDLEWARE_ANONYMOUS_ONLY kills anonymous caching efficiency
-----------------------------------+----------------------------------------
          Reporter:  carljm        |         Owner:  nobody                     
 
            Status:  new           |     Milestone:                             
 
         Component:  Cache system  |       Version:  SVN                        
 
        Resolution:                |      Keywords:  session accessed vary 
cookie
             Stage:  Accepted      |     Has_patch:  1                          
 
        Needs_docs:  0             |   Needs_tests:  0                          
 
Needs_better_patch:  1             |  
-----------------------------------+----------------------------------------
Comment (by natrius):

 My patch still caches responses that vary by cookie for anonymous users,
 which is probably undesirable for users who would want to set this in the
 first place. A setting that skips any response that varies by cookie is a
 cleaner and more effective way to do it. (My local patch makes altering
 the caching conditions in `UpdateCacheMiddleware` subclasses much easier
 and provides a `SkipVaryCookieUpdateCacheMiddleware` instead of a setting,
 which is a more extensible solution.)

 Having `CACHE_MIDDLEWARE_ANONYMOUS_ONLY` at all will give users an
 incorrect mental model of how caching in general works. Anonymity is
 irrelevant. `Vary` headers are the right place for users to be looking, so
 an appropriately named option that performs the correct behavior will have
 positive educational side-effects in addition to the small performance
 benefits.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13283#comment:20>
Django <http://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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to