summaryrefslogtreecommitdiff
path: root/docs/topics
diff options
context:
space:
mode:
Diffstat (limited to 'docs/topics')
-rw-r--r--docs/topics/cache.txt2
-rw-r--r--docs/topics/http/decorators.txt19
2 files changed, 20 insertions, 1 deletions
diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt
index ee8c30cfef..109bcc41ff 100644
--- a/docs/topics/cache.txt
+++ b/docs/topics/cache.txt
@@ -1209,7 +1209,7 @@ the value of the :setting:`CACHE_MIDDLEWARE_SECONDS` setting. If you use a custo
precedence, and the header values will be merged correctly.)
If you want to use headers to disable caching altogether,
-``django.views.decorators.cache.never_cache`` is a view decorator that adds
+:func:`django.views.decorators.cache.never_cache` is a view decorator that adds
headers to ensure the response won't be cached by browsers or other caches.
Example::
diff --git a/docs/topics/http/decorators.txt b/docs/topics/http/decorators.txt
index 25616a44c0..a310576fd5 100644
--- a/docs/topics/http/decorators.txt
+++ b/docs/topics/http/decorators.txt
@@ -97,3 +97,22 @@ caching based on specific request headers.
into account when building its cache key.
See :ref:`using vary headers <using-vary-headers>`.
+
+.. module:: django.views.decorators.cache
+
+Caching
+=======
+
+The decorators in :mod:`django.views.decorators.cache` control server and
+client-side caching.
+
+.. function:: never_cache(view_func)
+
+ This decorator adds a ``Cache-Control: max-age=0, no-cache, no-store,
+ must-revalidate`` header to a response to indicate that a page should never
+ be cached.
+
+ .. versionchanged:: 1.9
+
+ Before Django 1.9, ``Cache-Control: max-age=0`` was sent. This didn't
+ reliably prevent caching in all browsers.