Class: Beats::Rack::Cache

Inherits:
Rack::Cache::Context
  • Object
show all
Defined in:
lib/beats/rack/cache.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}, &b) ⇒ Cache

Returns a new instance of Cache.



31
32
33
34
35
36
37
# File 'lib/beats/rack/cache.rb', line 31

def initialize(app, options={}, &b)
  options = {
    :metastore => ENV['MEMCACHE_SERVERS'] ? Dalli::Client.new(:namespace => 'rack-cache:meta', :compress => true) : 'heap:/',
    :entitystore => ENV['MEMCACHE_SERVERS'] ? Dalli::Client.new(:namespace => 'rack-cache:body', :compress => true) : 'heap:/'
  }.merge(options)
  super(app, options, &b)
end