diff options
author | Adrian Holovaty <adrian@holovaty.com> | 2005-10-31 03:17:39 +0000 |
---|---|---|
committer | Adrian Holovaty <adrian@holovaty.com> | 2005-10-31 03:17:39 +0000 |
commit | 546e368d0b0a0d74b13a756fa67e162709af22e8 (patch) | |
tree | a4d5a1260a66e6ee6e2c5c00a32638dc647102c3 | |
parent | cbe24263692641af8908da21d1a2d333100a468a (diff) | |
download | django-546e368d0b0a0d74b13a756fa67e162709af22e8.tar.gz |
More tightening of docs/cache.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1031 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r-- | docs/cache.txt | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/docs/cache.txt b/docs/cache.txt index 6c1a3140d5..f8986b9115 100644 --- a/docs/cache.txt +++ b/docs/cache.txt @@ -306,24 +306,23 @@ allows applications to do the following: because the cache copy isn't yet expired.) In Django, use the ``cache_control`` view decorator to specify these cache -parameters. In this example, the ``cache_control`` decorator tells caches to -revalidate the cache on every access and to store cached versions for, at most, -3600 seconds:: +parameters. In this example, ``cache_control`` tells caches to revalidate the +cache on every access and to store cached versions for, at most, 3600 seconds:: from django.views.decorators.cache import cache_control @cache_control(must_revalidate=True, max_age=3600) def my_view(request): ... -Any valid Cache-Control directive is valid in ``cache_control()``. For a full -list, see the `Cache-Control spec`_. Just pass the directives as keyword +Any valid ``Cache-Control`` directive is valid in ``cache_control()``. For a +full list, see the `Cache-Control spec`_. Just pass the directives as keyword arguments to ``cache_control()``, substituting underscores for hyphens. For directives that don't take an argument, set the argument to ``True``. Examples: - ``@cache_control(max_age=3600)`` turns into ``max-age=3600``. - ``@cache_control(public=True)`` turns into ``public``. + * ``@cache_control(max_age=3600)`` turns into ``max-age=3600``. + * ``@cache_control(public=True)`` turns into ``public``. (Note that the caching middleware already sets the cache header's max-age with the value of the ``CACHE_MIDDLEWARE_SETTINGS`` setting. If you use a custom |