premcache: caching and precaching with memcached
Lets imagine that you have a list view of some data which takes a long time to generate, one second or so to suck the data from the database. This is unreasonable for a site of any proportion, and you certainly don’t want to re-run query every time someone hits the page.
The easy solution here is to cache the data, but today I’m going to show you a trick to precache the data so that each page load is blazing fast without sacrificing user experience.
I’m going to assume you know how to use memcached. Note that you can of course use all types of caching, but for the purposes of this exercise we’re assuming they don’t exist.


Loading...