#13894: Disable upstream caching with messages framework
---------------------------+------------------------------------------------
 Reporter:  bronger        |       Owner:  nobody    
   Status:  new            |   Milestone:            
Component:  Uncategorized  |     Version:  1.2       
 Keywords:                 |       Stage:  Unreviewed
Has_patch:  0              |  
---------------------------+------------------------------------------------
 Upstream caching should be disabled when messages have been consumed in
 the current request.  I added

 {{{
     if request._messages.used:
         add_never_cache_headers(response)
 }}}

 to "process_response" of !MessageMiddleware and it works nicely for me.
 Doesn't it make sense to do that always, or at least, by default?

 Rationale:

 When the message framework is used and the messages are iterared over in
 the current view, this means that it is posible that they are displayed
 and consumed.  Thus, when the same page is retrieved next time, they won't
 appear, or with different content.

 It is very difficult to handle this in cache-related code of that view
 because the messages have been generated in a previous request, which may
 even belong to another view.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13894>
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to