summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDavid D Lowe <daviddlowe.flimm@gmail.com>2019-09-07 16:16:27 +0100
committerCarlton Gibson <carlton.gibson@noumenal.es>2020-09-17 14:29:00 +0200
commitb9ee225d086314b75aa75c569c527960c6fdb6d9 (patch)
treec2727697b8a7504fa9d255c813e6827e87ccd1e9 /docs
parent17a408207800ec3ceaf9c29fbb2c42629fd0ff76 (diff)
[3.1.x] Doc'd that UpdateCacheMiddleware and cache_page affect downstream caches.
Thanks to Nick Pope for review. Backport of f3901b5899d746dc5b754115d94ce9a045b4db0a from master
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/cache.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt
index 330b40dad7..481f7bb606 100644
--- a/docs/topics/cache.txt
+++ b/docs/topics/cache.txt
@@ -515,8 +515,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
return a cached GET response for HEAD request.
-Additionally, ``UpdateCacheMiddleware`` automatically sets a few headers in each
-:class:`~django.http.HttpResponse`:
+Additionally, ``UpdateCacheMiddleware`` automatically sets a few headers in
+each :class:`~django.http.HttpResponse` which affect :ref:`downstream caches
+<downstream-caches>`:
* Sets the ``Expires`` header to the current date/time plus the defined
:setting:`CACHE_MIDDLEWARE_SECONDS`.
@@ -607,6 +608,10 @@ The ``key_prefix`` and ``cache`` arguments may be specified together. The
``key_prefix`` argument and the :setting:`KEY_PREFIX <CACHES-KEY_PREFIX>`
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
In older versions, the ``max-age`` directive from the ``Cache-Control``
@@ -1095,6 +1100,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
:setting:`BACKEND <CACHES-BACKEND>` portion of your :setting:`CACHES` setting.
+.. _downstream-caches:
+
Downstream caches
=================