Skip to content
Eldho Mathulla edited this page Mar 10, 2017 · 1 revision

Welcome to the spring17-django-portal wiki!

Distributed Cache: Redis integration with Django Caching mechanism

Redis is essentially a distributed highly available key-value pair store. Since Redis itself is a highly available distributed system it can be used for caching purpose shared across multiple instances of application of any kind.

What to Cache?

One of the key questions when dealing with Caching is what exactly should you cache. In a Django portal there different things that cache be cached like query results, objects, page views and so on. In order to understand which is the best thing to cache, we implement the caching in the Django portal using the following criteria: query results, objects and the page views.

Page Views

By default Django caching mechanism caches page views. This can range from a specific view to a single page to the whole site. In order to add Redis as a caching mechanism, the default caching mechanism has to be extended to do so.This done by extending BaseCache of the Django and using the new RedisCache that extended the BaseCache to directly as the cache in the Django settings.

Clone this wiki locally