diff options
| author | Frankie Robertson <frankie@robertson.name> | 2014-12-23 15:38:34 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-12-23 14:40:35 -0500 |
| commit | 126eb58abef119b799f81bd3626cb777910847cf (patch) | |
| tree | a7382bbd76f88c4aae4c1241a1f426a528f0ea12 /docs | |
| parent | 51ea30a43bafad40b4a24ad0be346796a9c7ab6a (diff) | |
[1.7.x] Fixed #24035 -- Clarified docs on CACHE_MIDDLEWARE_KEY_PREFIX vs KEY_PREFIX
Backport of 446b50b90e9e60760618b236d8b0ea75a3b19d5a from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/settings.txt | 11 | ||||
| -rw-r--r-- | docs/topics/cache.txt | 8 |
2 files changed, 12 insertions, 7 deletions
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 0f39d23c6d..87760b86e2 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -283,7 +283,8 @@ CACHE_MIDDLEWARE_ALIAS Default: ``default`` -The cache connection to use for the cache middleware. +The cache connection to use for the :ref:`cache middleware +<the-per-site-cache>`. .. setting:: CACHE_MIDDLEWARE_ANONYMOUS_ONLY @@ -312,7 +313,9 @@ CACHE_MIDDLEWARE_KEY_PREFIX Default: ``''`` (Empty string) -The cache key prefix that the cache middleware should use. +A string which will be prefixed to the cache keys generated by the :ref:`cache +middleware <the-per-site-cache>`. This prefix is combined with the +:setting:`KEY_PREFIX <CACHES-KEY_PREFIX>` setting; it does not replace it. See :doc:`/topics/cache`. @@ -323,8 +326,8 @@ CACHE_MIDDLEWARE_SECONDS Default: ``600`` -The default number of seconds to cache a page when the caching middleware or -``cache_page()`` decorator is used. +The default number of seconds to cache a page for the :ref:`cache middleware +<the-per-site-cache>`. See :doc:`/topics/cache`. diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt index 0771a2f7f0..07b28c9d0d 100644 --- a/docs/topics/cache.txt +++ b/docs/topics/cache.txt @@ -435,6 +435,8 @@ of 60 seconds, and a maximum capacity of 1000 items:: Invalid arguments are silently ignored, as are invalid values of known arguments. +.. _the-per-site-cache: + The per-site cache ================== @@ -561,9 +563,9 @@ setting for the middleware. It can be used like this:: def my_view(request): ... -The two settings can also be combined. If you specify a ``cache`` *and* -a ``key_prefix``, you will get all the settings of the requested cache -alias, but with the key_prefix overridden. +The ``key_prefix and ``cache`` arguments may be specified together. The +``key_prefix`` argument and the :setting:`KEY_PREFIX <CACHES-KEY_PREFIX>` +specified under :setting:`CACHES` will be concatenated. Specifying per-view cache in the URLconf ---------------------------------------- |
