It should be possible to set the 'rack-cache.metastore' and
'rack-cache.entitystore' Rack environment values somewhere before the
Rack::Cache middleware.
class CachePicker < Struct.new(:app)
def call(env)
domain = env['SERVER_NAME']
env['rack-cache.metastore'] = "file:/tmp/#{domain}/cache/meta"
env['rack-cache.entitystore'] = "file:/tmp/#{domain}/cache/entity"
app.call(env)
end
end
And then put that somewhere before Rack::Cache in config.ru (or
wherever you assemble the middleware pipeline):
use CachePicker
use Rack::Cache
It's worth noting that all of Rack::Cache's configuration values work
this way, so you can set them at boot time or at request time.
Thanks,
Ryan
> --
> You received this message because you are subscribed to the Google
> Groups "rack-cache" group.
> To post to this group, send email to rack-...@googlegroups.com.
> To unsubscribe from this group, send email to rack-cache+...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/rack-cache?hl=en
> .
>