summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/releases/1.6.txt6
-rw-r--r--docs/topics/cache.txt13
2 files changed, 15 insertions, 4 deletions
diff --git a/docs/releases/1.6.txt b/docs/releases/1.6.txt
index c9b3715c45..60b3381dd6 100644
--- a/docs/releases/1.6.txt
+++ b/docs/releases/1.6.txt
@@ -485,6 +485,12 @@ Miscellaneous
changes in 1.6 particularly affect :class:`~django.forms.DecimalField` and
:class:`~django.forms.ModelMultipleChoiceField`.
+* There have been changes in the way timeouts are handled in cache backends.
+ Explicitly passing in ``timeout=None`` no longer results in using the
+ default timeout. It will now set a non-expiring timeout. Passing 0 into the
+ memcache backend no longer uses the default timeout, and now will
+ set-and-expire-immediately the value.
+
Features deprecated in 1.6
==========================
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``::