From 7a7b331cd5975477597dac4dec7ee0ddb67f59e0 Mon Sep 17 00:00:00 2001 From: Bo Marchman Date: Wed, 15 Mar 2017 13:01:21 -0400 Subject: Fixed #27882 -- Allowed {% cache %} to cache indefinitely. --- docs/topics/cache.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt index 6c8c736363..42f178ee30 100644 --- a/docs/topics/cache.txt +++ b/docs/topics/cache.txt @@ -659,8 +659,9 @@ the ``cache`` template tag. To give your template access to this tag, put The ``{% cache %}`` template tag caches the contents of the block for a given amount of time. It takes at least two arguments: the cache timeout, in seconds, -and the name to give the cache fragment. The name will be taken as is, do not -use a variable. For example: +and the name to give the cache fragment. The fragment is cached forever if +timeout is ``None``. The name will be taken as is, do not use a variable. For +example: .. code-block:: html+django @@ -669,6 +670,10 @@ use a variable. For example: .. sidebar .. {% endcache %} +.. versionchanged:: 2.0 + + Older versions don't allow a ``None`` timeout. + Sometimes you might want to cache multiple copies of a fragment depending on some dynamic data that appears inside the fragment. For example, you might want a separate cached copy of the sidebar used in the previous example for every user -- cgit v1.3