Configure project to use redis
as cache through django-redis-cache
package.
Redis is already used by channels
, so we use different redis databases:
- Cache use db
#1
of redis. - Channel layer use db
#0
of redis (as before, but we specify this now)
Moreover, settings
try getting redis connection variables from environment.
Till now, local-memory cache was used, which is the default but doesn't convenient with multiple workers because the cache is per-process.