29.4.3 Caching with Memcache

In Chapter 26, we discussed how to limit the amount of work our website has to do. One way to avoid work is to cache results. At the end of the chapter, we disabled our site-wide caching settings to make development easier. In this section, we reenable caching and configure our caching to work with one of the industry’s fastest out-of-the-box in-memory caches: Memcache.

At the time of writing, there are two services that provide access to managed memcache services on the Heroku platform: the Memcached Cloud and Memcachier. I opt to use Memcachier. The first step, as always, is to read the documentation (Example 29.58).

Example 29.58: Shell Code

$ heroku addons:docs memcachier

Info ...

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.