diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-09-15 18:43:49 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-09-15 18:43:49 +0000 |
| commit | 41e622e17056a4acc7f14df9535aa34938c6c75d (patch) | |
| tree | cabd1ae9e0f44fd71f73fafdf0c9ed9f08c24372 /docs | |
| parent | d3c2dd30d606565fc43a78f4209f269e72515b54 (diff) | |
Fixed #5284 -- Documented never_cache decorator. Thanks, xbito
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6308 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/cache.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/cache.txt b/docs/cache.txt index 92b5c1b43d..8ba0383909 100644 --- a/docs/cache.txt +++ b/docs/cache.txt @@ -524,6 +524,15 @@ the value of the ``CACHE_MIDDLEWARE_SETTINGS`` setting. If you use a custom ``max_age`` in a ``cache_control`` decorator, the decorator will take precedence, and the header values will be merged correctly.) +If you want to use headers to disable caching altogether, +``django.views.decorators.never_cache`` is a view decorator that adds +headers to ensure the response won't be cached by browsers or other caches. Example:: + + from django.views.decorators.cache import never_cache + @never_cache + def myview(request): + ... + .. _`Cache-Control spec`: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 Other optimizations |
