【发布时间】:2011-05-10 11:25:14
【问题描述】:
我需要使用 memcached 和基于文件的缓存。 我在设置中设置了我的缓存:
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
'LOCATION': 'c:/foo/bar',
},
'inmem': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
dummy 是暂时的。 文档说:
cache.set('my_key', 'hello, world!', 30)
cache.get('my_key')
好的,但是我现在如何设置和获取仅为“inmem”缓存后端(将来的 memcached)的缓存?文档没有提到如何做到这一点。
【问题讨论】:
标签: django django-cache django-caching