diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/6.2.txt | 5 | ||||
| -rw-r--r-- | docs/topics/cache.txt | 19 |
2 files changed, 22 insertions, 2 deletions
diff --git a/docs/releases/6.2.txt b/docs/releases/6.2.txt index f88beb6fa0..09dab3a93d 100644 --- a/docs/releases/6.2.txt +++ b/docs/releases/6.2.txt @@ -108,7 +108,10 @@ Asynchronous views Cache ~~~~~ -* ... +* Subclasses of ``BaseDatabaseCache`` now support :ref:` + culling <_database-caching>` on a percentage of writes as an optimization. + The default is 10%, and may be configured using the ``CULL_PROBABILITY`` + option. CSP ~~~ diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt index 9af28a9324..587a91859e 100644 --- a/docs/topics/cache.txt +++ b/docs/topics/cache.txt @@ -254,7 +254,16 @@ In this example, the cache table's name is ``my_cache_table``:: Unlike other cache backends, the database cache does not support automatic culling of expired entries at the database level. Instead, expired cache -entries are culled each time ``add()``, ``set()``, or ``touch()`` is called. +entries are culled when an ``add()``, ``set()``, or ``touch()`` is called. + +Since the cull operation can be expensive for a large cache, you may control +how often this check occurs by setting ``CULL_PROBABILITY`` to a value between +0 and 1. This makes the cull probabilistic, occurring on that percentage of +writes. The default is ``0.1`` (10%). + +.. versionadded:: 6.2 + + The ``CULL_PROBABILITY`` option was added. .. _database-caching-creating-the-table: @@ -499,6 +508,14 @@ behavior. These arguments are provided as additional keys in the On some backends (``database`` in particular) this makes culling *much* faster at the expense of more cache misses. + * ``CULL_PROBABILITY``: The percentage of writes that will trigger a cull on + the database backend. This value should be between 0 and 1: the default is + ``0.1``. + + .. versionadded:: 6.2 + + The ``CULL_PROBABILITY`` option was added. + The Memcached and Redis backends pass the contents of :setting:`OPTIONS <CACHES-OPTIONS>` as keyword arguments to the client constructors, allowing for more advanced control of client behavior. For example usage, see below. |
