summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorCurtis Maloney <curtis@tinbrain.net>2013-10-04 07:36:21 +1000
committerTim Graham <timograham@gmail.com>2013-10-23 19:27:08 -0400
commit8688f03eef9cf5fd763ba35481ddcff933a60c30 (patch)
tree2f3e1644eb31beecc4e128e4770b29c6c82fc186 /docs
parent4ce5c119b5a6109058500e207333cc6889d78abe (diff)
Fixed #20945 -- Allowed cache tag to use a specific cache.
Diffstat (limited to 'docs')
-rw-r--r--docs/releases/1.7.txt5
-rw-r--r--docs/topics/cache.txt13
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