Although Memcached is well established in the market as a caching mechanism, and well supported by Django, an alternate system that provides all the functionality of Memcached and more is Redis. Here, we'll revisit the process from the Using Memcached to cache Django views recipe, and learn how to do the same using Redis instead.
Using Redis to cache Django views
Getting ready
There are several things to do in order to prepare caching for your Django project. First, let's examine how this would be done for a virtual environment project:
- Install Redis server, as follows:
$ wget http://download.redis.io/releases/redis-4.0.9.tar.gz
$ tar -zxvf redis-4.0.9.tar.gz
$ cd redis-4.0.9
$ make
- Create a configuration file to...