module Rack::Cache

HTTP Caching For Rack

Rack::Cache is suitable as a quick, drop-in component to enable HTTP caching for Rack-enabled applications that produce freshness (expires, cache-control) and/or validation (last-modified, etag) information.

Usage

Create with default options:

require 'rack/cache'
Rack::Cache.new(app, :verbose => true, :entitystore => 'file:cache')

Within a rackup file (or with Rack::Builder):

require 'rack/cache'
use Rack::Cache do
  set :verbose, true
  set :metastore, 'memcached://localhost:11211/meta'
  set :entitystore, 'file:/var/cache/rack'
end
run app