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.



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

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