15 June 2012 by Rolo Mawlabaux
Johnny Cache is a popular Django application that provides a very simple way to cache querysets. However, when moving to Heroku or using Redis as a cache backend, there are several configurations to consider for optimal performance.
Why Redis?
Redis offers incredible speed and persistence, making it an ideal choice for Django's caching mechanism. By using django-redis as the bridge, we ensure that Johnny Cache interacts seamlessly with the volatile memory store.
Configuration Tips
- Ensure your
CACHESsetting insettings.pypoints to the specific Redis instance URL provided by your Heroku add-on provider. - Monitor cache hits/misses using the command line interface to ensure that the invalidation logic is working as expected.
- Be mindful of the cache size; while Redis is fast, it is still memory-bound.
By effectively combining Johnny Cache with a robust Redis setup, you can significantly reduce database load and improve application response times for your Django projects.