NAME
Angerwhale::Plugin::Cache - Catalyst plugin that caches responses and serves them when appropriate.
SYNOPSIS
package Angerwhale;
use Catalyst qw/... +Angerwhale::Plugin::Cache .../;
DESCRIPTION
On request, call back into the application to get a "revision number" of the data. If there's a cached version of this URL for the current revision, then return the cached version instead executing the whole request.
If the server sends conditional request headers, check the condition and send a 304 if that would be correct.
If the client supports gzip, send the gzipped version of the content, which is computed regardless and cached along with non-gzipped version.
(bandwidth savings)++
METHODS
cache_ie_list
include/exclude list accessor
cache_callback
callback accessor
setup
Init the plugin
prepare
Get the cache ID during prepare step.
dispatch
Kill the dispatch cycle if we're going to return a cached response.
finalize
Store the document we generated during finalize_* to the cache
_gzip_response
Returns true if the client would accept a gzip'd response.
_is_304($key, $document)
Returns true if we should 304
_key($revision, $uri)
Get the cache key for a given revision/URI pair
CONFIGURATION
Needs a coderef in $c->config->{revision_callback} to return the revision number.