mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #22085 -- Added a feature for setting non-expiring keys as the default.
This feature allows the default `TIMEOUT` Cache argument to be set to `None`, so that cache instances can set a non-expiring key as the default, instead of using the default value of 5 minutes. Previously, this was possible only by passing `None` as an argument to the set() method of objects of type `BaseCache` (and subtypes).
This commit is contained in:
@@ -363,9 +363,14 @@ Each cache backend can be given additional arguments to control caching
|
||||
behavior. These arguments are provided as additional keys in the
|
||||
:setting:`CACHES` setting. Valid arguments are as follows:
|
||||
|
||||
|
||||
* :setting:`TIMEOUT <CACHES-TIMEOUT>`: The default timeout, in
|
||||
seconds, to use for the cache. This argument defaults to ``300``
|
||||
seconds (5 minutes).
|
||||
seconds, to use for the cache. This argument defaults to ``300`` seconds (5 minutes).
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
You can set ``TIMEOUT`` to ``None`` so that, by default, cache keys never
|
||||
expire.
|
||||
|
||||
* :setting:`OPTIONS <CACHES-OPTIONS>`: Any options that should be
|
||||
passed to the cache backend. The list of valid options will vary
|
||||
|
||||
Reference in New Issue
Block a user