--
Ticket URL: <https://code.djangoproject.com/ticket/27211>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* component: Core (Cache system) => HTTP handling
* needs_tests: => 0
* needs_docs: => 0
Comment:
I didn't spot a reason for the behavior in the original ticket (#580). Can
you motivate this change with an example? You say "most browsers can cache
responses with 304 HTTP code" -- any idea why all browsers don't?
--
Ticket URL: <https://code.djangoproject.com/ticket/27211#comment:1>
Comment (by renskiy):
The server generating a 304 response MUST generate any of the
following header fields that would have been sent in a 200 (OK)
response to the same request: Cache-Control, Content-Location, Date,
ETag, Expires, and Vary.
Taken from RFC7232: [https://tools.ietf.org/html/rfc7232#section-4.1].
Usually responses with 200 code will include such headers (e.g. from views
decorated with cache_page), so according to the RFC responses with 304
code must also include them.
--
Ticket URL: <https://code.djangoproject.com/ticket/27211#comment:2>
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/27211#comment:3>
Old description:
> Most browsers can cache responses with 304 HTTP code. So why not to
> include such headers to response if necessary.
New description:
Most browsers can cache responses with 304 HTTP code. So why not to
include such headers to response if necessary.
'''UPDATE''':
According to the [https://tools.ietf.org/html/rfc7232 RFC7232] all "304
Not Modified" responses must include "Cache-Control" and "Expires" headers
that would have been sent in a corresponding "200 OK" response.
See [https://tools.ietf.org/html/rfc7232#section-4.1 Section 4.1 of
RFC7232]
--
--
Ticket URL: <https://code.djangoproject.com/ticket/27211#comment:4>
* has_patch: 0 => 1
* type: New feature => Bug
* stage: Unreviewed => Accepted
Old description:
> Most browsers can cache responses with 304 HTTP code. So why not to
> include such headers to response if necessary.
>
> '''UPDATE''':
> According to the [https://tools.ietf.org/html/rfc7232 RFC7232] all "304
> Not Modified" responses must include "Cache-Control" and "Expires"
> headers that would have been sent in a corresponding "200 OK" response.
>
> See [https://tools.ietf.org/html/rfc7232#section-4.1 Section 4.1 of
> RFC7232]
New description:
According to [https://tools.ietf.org/html/rfc7232#section-4.1 RFC7232] all
"304 Not Modified" responses must include "Cache-Control" and "Expires"
headers that would have been sent in a corresponding "200 OK" response.
--
Comment:
[https://github.com/django/django/pull/7236 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/27211#comment:5>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/27211#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"f9702977b72003c17db87d6e4fdaa36415f13a38" f9702977]:
{{{
#!CommitTicketReference repository=""
revision="f9702977b72003c17db87d6e4fdaa36415f13a38"
Fixed #27211 -- Made UpdateCacheMiddleware include caching headers for
"304 Not Modified" responses.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27211#comment:7>