Django provides a possibility to speed up the request-response cycle by caching the most expensive parts such as database queries or template rendering. The fastest and most reliable caching natively supported by Django is the memory-based cache server Memcached. In this recipe, you will learn how to use Memcached to cache a view for the viral_videos app, created in the Using database query expressions recipe in Chapter 11, Bells and Whistles.
Using Memcached 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 the memcached server, as follows:
$ wget http://memcached...