diff options
| author | Rinat Khabibiev <srenskiy@gmail.com> | 2016-09-15 11:10:21 +0300 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-09-28 09:09:09 -0400 |
| commit | 9e07a9b5feb30fe06fb23d0e77edd34f6c3f92b5 (patch) | |
| tree | 8e12ba737b2aa97bf959166858df5d4cdc06d6ee /django/utils/cache.py | |
| parent | 32031718320e1b4d708b15d8c67738e4c77c9bc7 (diff) | |
Fixed #27226 -- Removed patch_response_headers()'s setting of the Last-Modified header.
Diffstat (limited to 'django/utils/cache.py')
| -rw-r--r-- | django/utils/cache.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/django/utils/cache.py b/django/utils/cache.py index ac469195da..e74bfbea5d 100644 --- a/django/utils/cache.py +++ b/django/utils/cache.py @@ -229,8 +229,8 @@ def _if_modified_since_passes(last_modified, if_modified_since): def patch_response_headers(response, cache_timeout=None): """ - Adds some useful headers to the given HttpResponse object: - ETag, Last-Modified, Expires and Cache-Control + Add HTTP caching headers to the given HttpResponse: Expires and + Cache-Control. Each header is only added if it isn't already set. @@ -246,8 +246,6 @@ def patch_response_headers(response, cache_timeout=None): response.add_post_render_callback(set_response_etag) else: response = set_response_etag(response) - if not response.has_header('Last-Modified'): - response['Last-Modified'] = http_date() if not response.has_header('Expires'): response['Expires'] = http_date(time.time() + cache_timeout) patch_cache_control(response, max_age=cache_timeout) |
