diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/1.7.txt | 5 | ||||
| -rw-r--r-- | docs/topics/cache.txt | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt index e71fc5b65c..7ce13066bf 100644 --- a/docs/releases/1.7.txt +++ b/docs/releases/1.7.txt @@ -396,6 +396,11 @@ Templates <naive_vs_aware_datetimes>` ``datetime`` instances performing the expected rendering. +* The :ttag:`cache` tag will now try to use the cache called + "template_fragments" if it exists and fall back to using the default cache + otherwise. It also now accepts an optional ``using`` keyword argument to + control which cache it uses. + Requests ^^^^^^^^ diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt index 4e37eeb3f4..f61e3ffbd3 100644 --- a/docs/topics/cache.txt +++ b/docs/topics/cache.txt @@ -652,6 +652,19 @@ equivalent: This feature is useful in avoiding repetition in templates. You can set the timeout in a variable, in one place, and just reuse that value. +.. versionadded:: 1.7 + + By default, the cache tag will try to use the cache called + "template_fragments". If no such cache exists, it will fall back to using + the default cache. You may select an alternate cache backend to use with + the ``using`` keyword argument, which must be the last argument to the tag. + +.. code-block:: html+django + + {% cache 300 local-thing ... using="localcache" %} + +It is considered an error to specify a cache name that is not configured. + .. function:: django.core.cache.utils.make_template_fragment_key(fragment_name, vary_on=None) If you want to obtain the cache key used for a cached fragment, you can use |
