Shift wiki and course.xml caching to use newly defined 'general' cache, separate from sessions left in 'default'
--HG-- branch : cache_separation
This commit is contained in:
16
util/cache.py
Normal file
16
util/cache.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
This module aims to give a little more fine-tuned control of caching and cache
|
||||
invalidation. Import these instead of django.core.cache.
|
||||
|
||||
Note that 'default' is being preserved for user session caching, which we're
|
||||
not migrating so as not to inconvenience users by logging them all out.
|
||||
"""
|
||||
from django.core import cache
|
||||
|
||||
# If we can't find a 'general' CACHE defined in settings.py, we simply fall back
|
||||
# to returning the default cache. This will happen with dev machines.
|
||||
try:
|
||||
cache = cache.get_cache('general')
|
||||
except ValueError:
|
||||
cache = cache.cache
|
||||
|
||||
Reference in New Issue
Block a user