#32335: Cache Control decorator should not cache 500 status code responses
-------------------------------------+-------------------------------------
               Reporter:             |          Owner:  (none)
  varunpatil                         |
                   Type:  Bug        |         Status:  new
              Component:  Error      |        Version:  master
  reporting                          |       Keywords:  cache control bad
               Severity:  Normal     |  response decorator
           Triage Stage:             |      Has patch:  1
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  1
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 cache control decorator in 'django.views.decorators.cache' caches "bad"
 responses.

 If something goes wrong in my view and it returns a 500 response, I dont
 want that to be cached.
 According to https://developer.mozilla.org/en-
 US/docs/Web/HTTP/Caching#targets_of_caching_operations , only 200, 301,
 404, 206 are generally cached.

 This can be quickly fixed in 'django.utils.cache.patch_cache_control' by
 checking if the response code is among the ones specified above. Or
 optionally, let the user decide which status codes to be cached/not cached

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32335>
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/053.5e4994ca0e09918465b03296cfc360ec%40djangoproject.com.

Reply via email to