diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-11-29 20:38:41 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-11-29 20:38:41 +0000 |
| commit | dfe05d94b853073e2762250e1b4cd64ce9ef1df0 (patch) | |
| tree | 4e6aea30920e85556903dd67ca329fe69e9f2a7d /docs/cache.txt | |
| parent | b43a0180322b42925c4c27b5ccdf2e876309c53b (diff) | |
queryset-refactor: Merged from trunk up to [6752].
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6753 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/cache.txt')
| -rw-r--r-- | docs/cache.txt | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/docs/cache.txt b/docs/cache.txt index 4f177b8c07..6dfe2bf5ee 100644 --- a/docs/cache.txt +++ b/docs/cache.txt @@ -263,6 +263,18 @@ See the `middleware documentation`_ for more on middleware. .. _`middleware documentation`: ../middleware/ +**New in Django development version** + +If a view sets its own cache expiry time (i.e. it has a ``max-age`` section in +its ``Cache-Control`` header) then the page will be cached until the expiry +time, rather than ``CACHE_MIDDLEWARE_SECONDS``. Using the decorators in +``django.views.decorators.cache`` you can easily set a view's expiry time +(using the ``cache_control`` decorator) or disable caching for a view (using +the ``never_cache`` decorator). See the `using other headers`__ section for +more on these decorators. + +__ `Controlling cache: Using other headers`_ + The per-view cache ================== @@ -566,7 +578,7 @@ the value of the ``CACHE_MIDDLEWARE_SETTINGS`` setting. If you use a custom 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 +``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:: from django.views.decorators.cache import never_cache |
