diff options
| author | Jacob Burch <jacobburch@gmail.com> | 2013-05-18 12:54:59 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-05-18 15:39:42 +0200 |
| commit | 89955cc35f3636684ea6f2a6c9504b35a3050f0f (patch) | |
| tree | 99e4f6a70e3ce3826aabda970d7f25af0fbc4b30 /docs/topics | |
| parent | e0df647143dd595aba0e9f077703775a226d015f (diff) | |
Fixed #9595 -- Allow non-expiring cache timeouts.
Also, streamline the use of 0 and None between cache backends.
Diffstat (limited to 'docs/topics')
| -rw-r--r-- | docs/topics/cache.txt | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt index 6b6d57511a..a7d54fbeb0 100644 --- a/docs/topics/cache.txt +++ b/docs/topics/cache.txt @@ -707,10 +707,15 @@ The basic interface is ``set(key, value, timeout)`` and ``get(key)``:: >>> cache.get('my_key') 'hello, world!' -The ``timeout`` argument is optional and defaults to the ``timeout`` -argument of the appropriate backend in the :setting:`CACHES` setting -(explained above). It's the number of seconds the value should be stored -in the cache. +The ``timeout`` argument is optional and defaults to the ``timeout`` argument +of the appropriate backend in the :setting:`CACHES` setting (explained above). +It's the number of seconds the value should be stored in the cache. Passing in +``None`` for ``timeout`` will cache the value forever. + +.. versionchanged:: 1.6 + + Previously, passing ``None`` explicitly would use the default timeout + value. If the object doesn't exist in the cache, ``cache.get()`` returns ``None``:: |
