summaryrefslogtreecommitdiff
path: root/docs/topics/cache.txt
diff options
context:
space:
mode:
authorFlavio Curella <flavio.curella@gmail.com>2019-09-26 11:41:38 -0700
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-01-16 13:39:16 +0100
commitd08d4f464ab11cc226d4e197c0f43e26a7fd2961 (patch)
tree568fce9e1eee95192ad4bf2e24edc3b3573cda3d /docs/topics/cache.txt
parent1e0dcd6c8bfa4519c21014c73eb510620dd1a000 (diff)
Fixed #30765 -- Made cache_page decorator take precedence over max-age Cache-Control directive.
Diffstat (limited to 'docs/topics/cache.txt')
-rw-r--r--docs/topics/cache.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt
index 29ea8fb001..bc6b96ecfe 100644
--- a/docs/topics/cache.txt
+++ b/docs/topics/cache.txt
@@ -570,6 +570,9 @@ minutes. (Note that we've written it as ``60 * 15`` for the purpose of
readability. ``60 * 15`` will be evaluated to ``900`` -- that is, 15 minutes
multiplied by 60 seconds per minute.)
+The cache timeout set by ``cache_page`` takes precedence over the ``max-age``
+directive from the ``Cache-Control`` header.
+
The per-view cache, like the per-site cache, is keyed off of the URL. If
multiple URLs point at the same view, each URL will be cached separately.
Continuing the ``my_view`` example, if your URLconf looks like this::
@@ -605,6 +608,11 @@ 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.
+.. versionchanged:: 3.1
+
+ In older versions, the ``max-age`` directive from the ``Cache-Control``
+ header had precedence over the cache timeout set by ``cache_page``.
+
Specifying per-view cache in the URLconf
----------------------------------------