#32335: Cache Control decorator should not cache 500 status code responses
-------------------------------------+-------------------------------------
Reporter: Varun Patil | Owner: (none)
Type: Bug | Status: new
Component: Error reporting | Version: master
Severity: Normal | Resolution:
Keywords: cache control bad | Triage Stage:
response decorator | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Varun Patil:
Old description:
> 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
New description:
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
other links:
https://tools.ietf.org/html/rfc7231#section-6.1
--
--
Ticket URL: <https://code.djangoproject.com/ticket/32335#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/068.05b2cc8305c56615e554cfb7987ebe93%40djangoproject.com.