--
Ticket URL: <https://code.djangoproject.com/ticket/27226>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => assigned
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/27226#comment:1>
Old description:
> '''cache.patch_response_headers()''' adds ETag and Last-Modified headers
> to the response while it is not it's responsibility. There are '''etag'''
> and '''last_modified''' decorators in '''django.views.decorators.http
> module''' to work with such headers.
New description:
'''cache.patch_response_headers()''' adds ETag and Last-Modified headers
to the response while it is not it's responsibility. There are '''etag'''
and '''last_modified''' decorators in '''django.views.decorators.http'''
module to work with such headers.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/27226#comment:2>
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted
Comment:
The ETag removal will go through a deprecation in #26447 so this ticket is
limited to removing the Last-Modified header. There's some discussion on
the [https://github.com/django/django/pull/7247 PR] about whether or not
removing it could result in behavior changes.
--
Ticket URL: <https://code.djangoproject.com/ticket/27226#comment:3>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/27226#comment:4>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"9e07a9b5feb30fe06fb23d0e77edd34f6c3f92b5" 9e07a9b]:
{{{
#!CommitTicketReference repository=""
revision="9e07a9b5feb30fe06fb23d0e77edd34f6c3f92b5"
Fixed #27226 -- Removed patch_response_headers()'s setting of the Last-
Modified header.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27226#comment:5>
Comment (by Josh Smeaton):
For future visitors, this change breaks the default Akamai caching
configuration which depends on a Last-Modified header. Akamai also allows
opting in to ETag based caching strategies, but it is not the default. To
fix Akamai caching, you'll need to add the Last-Modified header to the
response:
{{{
from django.utils.http import http_date
if not response.has_header('Last-Modified'):
response['Last-Modified'] = http_date()
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27226#comment:6>