1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #13795 -- Added a site-wide cache prefix and cache versioning. Thanks to bruth for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14623 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2010-11-19 15:39:35 +00:00
parent 261aee26c1
commit 99d247f4cb
12 changed files with 694 additions and 85 deletions

View File

@@ -136,6 +136,25 @@ Default: ``'locmem://'``
The cache backend to use. See :doc:`/topics/cache`.
.. setting:: CACHE_KEY_FUNCTION
CACHE_KEY_FUNCTION
------------------
Default: ``None``
A string containing a dotted path to a function that defines how to
compose a prefix, version and key into a final cache key. The default
implementation is equivalent to the function::
def make_key(key, key_prefix, version):
return ':'.join([key_prefix, str(version), smart_str(key)])
You may use any key function you want, as long as it has the same
argument signature.
See the :ref:`cache documentation <cache_key_transformation>` for more information.
.. setting:: CACHE_MIDDLEWARE_ANONYMOUS_ONLY
CACHE_MIDDLEWARE_ANONYMOUS_ONLY
@@ -172,6 +191,30 @@ Default: ``600``
The default number of seconds to cache a page when the caching middleware or
``cache_page()`` decorator is used.
.. setting:: CACHE_PREFIX
CACHE_PREFIX
------------
Default: ``''`` (Empty string)
A string that will be automatically included (prepended by default) to
all cache keys used by the Django server.
See the :ref:`cache documentation <cache_key_prefixing>` for more information.
.. setting:: CACHE_VERSION
CACHE_VERSION
-------------
Default: ``1``
The default version number for cache keys generated by the Django server.
See the :ref:`cache documentation <cache_versioning>` for more information.
.. setting:: CSRF_COOKIE_DOMAIN
CSRF_COOKIE_DOMAIN