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 /docs | |
| parent | 32031718320e1b4d708b15d8c67738e4c77c9bc7 (diff) | |
Fixed #27226 -- Removed patch_response_headers()'s setting of the Last-Modified header.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/utils.txt | 5 | ||||
| -rw-r--r-- | docs/releases/1.11.txt | 8 | ||||
| -rw-r--r-- | docs/topics/cache.txt | 7 |
3 files changed, 16 insertions, 4 deletions
diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index 00ac7970d7..a9072f9442 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -53,7 +53,6 @@ need to distinguish caches by the ``Accept-language`` header. Adds some useful headers to the given ``HttpResponse`` object: * ``ETag`` - * ``Last-Modified`` * ``Expires`` * ``Cache-Control`` @@ -62,6 +61,10 @@ need to distinguish caches by the ``Accept-language`` header. ``cache_timeout`` is in seconds. The :setting:`CACHE_MIDDLEWARE_SECONDS` setting is used by default. + .. versionchanged:: 1.11 + + In older versions, the ``Last-Modified`` header was also set. + .. function:: add_never_cache_headers(response) Adds a ``Cache-Control: max-age=0, no-cache, no-store, must-revalidate`` diff --git a/docs/releases/1.11.txt b/docs/releases/1.11.txt index 411c6fb3ab..a9de4b095b 100644 --- a/docs/releases/1.11.txt +++ b/docs/releases/1.11.txt @@ -539,6 +539,14 @@ Miscellaneous :rfc:`7232` Conditional Requests specification rather than the older :rfc:`2616`. +* :func:`~django.utils.cache.patch_response_headers` no longer adds a + ``Last-Modified`` header. According to the :rfc:`7234#section-4.2.2`, this + header is useless alongside other caching headers that provide an explicit + expiration time, e.g. ``Expires`` or ``Cache-Control``. + :class:`~django.middleware.cache.UpdateCacheMiddleware` and + :func:`~django.utils.cache.add_never_cache_headers` call + ``patch_response_headers()`` and therefore are also affected by this change. + * In the admin templates, ``<p class="help">`` is replaced with a ``<div>`` tag to allow including lists inside help text. diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt index 2a48a66abe..ec90d89bba 100644 --- a/docs/topics/cache.txt +++ b/docs/topics/cache.txt @@ -528,15 +528,16 @@ return a cached GET response for HEAD request. Additionally, ``UpdateCacheMiddleware`` automatically sets a few headers in each :class:`~django.http.HttpResponse`: -* Sets the ``Last-Modified`` header to the current date/time when a fresh - (not cached) version of the page is requested. - * Sets the ``Expires`` header to the current date/time plus the defined :setting:`CACHE_MIDDLEWARE_SECONDS`. * Sets the ``Cache-Control`` header to give a max age for the page -- again, from the :setting:`CACHE_MIDDLEWARE_SECONDS` setting. +.. versionchanged:: 1.11 + + In older versions, the ``Last-Modified`` header was also set. + See :doc:`/topics/http/middleware` for more on middleware. If a view sets its own cache expiry time (i.e. it has a ``max-age`` section in |
