You can use applications such as Memcached or Redis for external caching. These applications offer persistence and shared storage and are useful for small-scale deployments and/or development.
Memcached is a high-performance and distributed memory object caching system providing in-memory key-value store for small chunks of arbitrary data.
Requirements:
Memcached service running and accessible.
Python module
python-memcachedinstalled.
Enabled by:
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
CACHES = {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache'
'LOCATION': 'my_memcached_host:11211',
}Redis is an open source, BSD licensed, advanced key-value store. It is often referred to as a data structure server.
Requirements:
Redis service running and accessible.
Python modules
redisanddjango-redisinstalled.
Enabled by:
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
CACHES = {
"default": {
"BACKEND": "redis_cache.cache.RedisCache",
"LOCATION": "127.0.0.1:6379:1",
"OPTIONS": {
"CLIENT_CLASS": "redis_cache.client.DefaultClient",
}
}
}
