1 2 3 4 5 6 7 8 9 10 11 12 | from django.core.cache import cache
try:
cache._cache.clear() # in-memory caching
except AttributeError:
# try filesystem caching next
old = cache._cull_frequency
old_max = cache._max_entries
cache._max_entries = 0
cache._cull_frequency = 1
cache._cull()
cache._cull_frequency = old
cache._max_entries = old_max
|
More like this
- ImageField for Google App Engine by davepeck 3 years, 6 months ago
- In-memory XML-RPC server based on URL by diverman 2 years, 11 months ago
- Non-pickling locmem (in-process memory) cache backend by akaihola 2 years, 2 months ago
- CodeLookupField by girasquid 3 years, 11 months ago
- Django mediagenerator folder bundler by hcliff 1 year ago
Comments
At least for locmem one has to do clear also "_expire_info", otherwise there will be key errors:
#
if you're using memcached it's
#