README.rst

Jimmy Page alpha 0.1

Jimmy Page is a simple caching app for Django, inspired by Johnny Cache, but for whole pages rather than
querysets. It is an automatic generation-based page cache.

If Johnny Cache (generational caching of querysets) is the first line of
defense in caching, Jimmy Page is the last: it caches the output of views
forever, but with conservative expiration on database writes. Jimmy uses a
global "generation" number as part of the cache key, which is incremented
whenever any model is saved or deleted, expiring the whole page cache. This
technique is similar to that described by Open Logic
from the Rails community.

This technique provides easy whole-page caching, with an assurance that no part
of the site will ever contain stale content. The conservative approach to
expiration allows Jimmy to function in a drop-in manner, without any
domain-specific knowledge of how data updates might affect the output of views.
It will greatly speed up slowly updated sites, especially when used in
combination with Johnny Cache and carefully designed, more aggressive caching
for particularly intensive views. This technique is not likely to be effective
in sites that have a high ratio of database writes to reads.

Installation

This is the first, as yet largely untested alpha release. Some notes:

In order to function properly, Johnny Cache should be installed and used.
Johnny Cache patches the Django caching framework to allow caching with
infinite timeouts, something that this app does not provide alone. If you
don't want to use Johnny Cache, you should set the
JIMMY_PAGE_CACHE_SECONDS setting to something other than 0.

If you have any custom SQL that updates the database without emitting
post_save or pre_delete signals, things might get screwy. At this
stage, Jimmy Page works best with sites using vanilla ORM calls.

Any update to any table will clear the cache (by incrementing the generation),
unless the tables are included in the JIMMY_PAGE_EXPIRATION_WHITELIST. The
defaults can be overridden by defining it in your settings.py. By default it
includes:

Views are cached on a per-user, per-language, per-path basis. Anonymous users
share a cache, but authenticated users get a separate cache, ensuring that no
user will ever see another's user-specific content. The cache is only used if: