mirror of
https://github.com/django/django.git
synced 2025-04-01 03:56:42 +00:00
[1.5.x] Tweaked cache key creation to avoid strict typing.
This is a provisional change. See #19221 for details. Backport of 6c69de8 from master.
This commit is contained in:
parent
825a793555
commit
3db2aeec98
3
django/core/cache/backends/base.py
vendored
3
django/core/cache/backends/base.py
vendored
@ -12,6 +12,7 @@ class InvalidCacheBackendError(ImproperlyConfigured):
|
|||||||
class CacheKeyWarning(DjangoRuntimeWarning):
|
class CacheKeyWarning(DjangoRuntimeWarning):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
# Memcached does not accept keys longer than this.
|
# Memcached does not accept keys longer than this.
|
||||||
MEMCACHE_MAX_KEY_LENGTH = 250
|
MEMCACHE_MAX_KEY_LENGTH = 250
|
||||||
|
|
||||||
@ -23,7 +24,7 @@ def default_key_func(key, key_prefix, version):
|
|||||||
the `key_prefix'. KEY_FUNCTION can be used to specify an alternate
|
the `key_prefix'. KEY_FUNCTION can be used to specify an alternate
|
||||||
function with custom key making behavior.
|
function with custom key making behavior.
|
||||||
"""
|
"""
|
||||||
return ':'.join([key_prefix, str(version), key])
|
return '%s:%s:%s' % (key_prefix, version, key)
|
||||||
|
|
||||||
def get_key_func(key_func):
|
def get_key_func(key_func):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user