mirror of https://github.com/django/django.git
Doc'd that UpdateCacheMiddleware and cache_page affect downstream caches.
Thanks to Nick Pope for review.
This commit is contained in:
parent
8c0794ba0d
commit
f3901b5899
|
@ -530,8 +530,9 @@ cached separately. This middleware expects that a HEAD request is answered with
|
||||||
the same response headers as the corresponding GET request; in which case it can
|
the same response headers as the corresponding GET request; in which case it can
|
||||||
return a cached GET response for HEAD request.
|
return a cached GET response for HEAD request.
|
||||||
|
|
||||||
Additionally, ``UpdateCacheMiddleware`` automatically sets a few headers in each
|
Additionally, ``UpdateCacheMiddleware`` automatically sets a few headers in
|
||||||
:class:`~django.http.HttpResponse`:
|
each :class:`~django.http.HttpResponse` which affect :ref:`downstream caches
|
||||||
|
<downstream-caches>`:
|
||||||
|
|
||||||
* Sets the ``Expires`` header to the current date/time plus the defined
|
* Sets the ``Expires`` header to the current date/time plus the defined
|
||||||
:setting:`CACHE_MIDDLEWARE_SECONDS`.
|
:setting:`CACHE_MIDDLEWARE_SECONDS`.
|
||||||
|
@ -621,6 +622,10 @@ The ``key_prefix`` and ``cache`` arguments may be specified together. The
|
||||||
``key_prefix`` argument and the :setting:`KEY_PREFIX <CACHES-KEY_PREFIX>`
|
``key_prefix`` argument and the :setting:`KEY_PREFIX <CACHES-KEY_PREFIX>`
|
||||||
specified under :setting:`CACHES` will be concatenated.
|
specified under :setting:`CACHES` will be concatenated.
|
||||||
|
|
||||||
|
Additionally, ``cache_page`` automatically sets ``Cache-Control`` and
|
||||||
|
``Expires`` headers in the response which affect :ref:`downstream caches
|
||||||
|
<downstream-caches>`.
|
||||||
|
|
||||||
.. versionchanged:: 3.1
|
.. versionchanged:: 3.1
|
||||||
|
|
||||||
In older versions, the ``max-age`` directive from the ``Cache-Control``
|
In older versions, the ``max-age`` directive from the ``Cache-Control``
|
||||||
|
@ -1109,6 +1114,8 @@ instance, to do this for the ``locmem`` backend, put this code in a module::
|
||||||
...and use the dotted Python path to this class in the
|
...and use the dotted Python path to this class in the
|
||||||
:setting:`BACKEND <CACHES-BACKEND>` portion of your :setting:`CACHES` setting.
|
:setting:`BACKEND <CACHES-BACKEND>` portion of your :setting:`CACHES` setting.
|
||||||
|
|
||||||
|
.. _downstream-caches:
|
||||||
|
|
||||||
Downstream caches
|
Downstream caches
|
||||||
=================
|
=================
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue