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.
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>
* cc: Varun Patil (added)
* owner: (none) => Varun Patil
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/32335#comment:2>
* has_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/32335#comment:3>
* status: assigned => closed
* resolution: => invalid
--
Ticket URL: <https://code.djangoproject.com/ticket/32335#comment:4>