From 4a438e400b7ce0ab9d0b6876196cbe8d620a4171 Mon Sep 17 00:00:00 2001 From: Markus Bertheau Date: Mon, 27 Apr 2015 23:56:02 +0200 Subject: Fixed #13008 -- Added more Cache-Control headers to never_cache() decorator. --- docs/topics/http/decorators.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'docs/topics/http') 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 `. + +.. 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. -- cgit v1.3