from django.core.cache import caches, DEFAULT_CACHE_ALIAS cache = caches[DEFAULT_CACHE_ALIAS] cache.set(cache_key, data, timeout) 

The question is - I set the timeout in the cache, say, 300 seconds. Will the cache be reset 300 seconds after it is installed, or 300 seconds after the last access to it?

 data = cache.get(cache_key) 
  • I assume that after the moment of appeal - Mr Morgan
  • It depends on the storage used, not on the jungle. The caching databases known to me (memcached, redis) are reset after 300 seconds exactly after the installation - andreymal
  • if redis resets the cache after a specified time after installation, then my question can be considered closed. - A. Sklyarov

0