Configuration Language ====================== __Rack::Cache__ includes a configuration system that can be used to specify fairly sophisticated cache policy on a global or per-request basis. - [Synopsis](#synopsis) - [Setting Cache Options](#setopt) - [Cache Option Reference](#options) - [Configuration Machinery - Events and Transitions](#machinery) - [Importing Configuration](#import) - [Default Configuration Machinery](#default) - [Notes](#notes) Synopsis -------- use Rack::Cache do # set cache related options set :verbose, true set :metastore, 'memcached://localhost:11211' set :entitystore, 'file:/var/cache/rack/body' # override events / transitions on :receive do pass! if request.url =~ %r|/dontcache/| error! 402 if request.referrer =~ /digg.com/ end on :miss do trace 'missed: %s', request.url end # bring in other configuration machinery import 'rack/cache/config/breakers' import 'mycacheconfig' end Setting Cache Options --------------------- Cache options can be set when the __Rack::Cache__ object is created; or by using the `set` method within a configuration block; or by setting a `rack-cache.