Performance: Cache framework configuration
HIGH IMPACT
This affects page load speed by reducing server processing time and database queries through caching.
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://127.0.0.1:6379/1',
'OPTIONS': {
'CLIENT_CLASS': 'django_redis.client.DefaultClient'
}
}
}CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': 'unique-snowflake',
}
}| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Local memory cache (LocMemCache) | No impact | No impact | No impact | [X] Bad - limited to single process, poor scalability |
| Distributed cache (Redis/Memcached) | No impact | No impact | No impact | [OK] Good - shared cache reduces server load and speeds response |