class Rack::Cache::MetaStore::Dalli
Public Class Methods
Source
# File lib/rack/cache/meta_store.rb, line 335 def initialize(server="localhost:11211", options={}) @cache = if server.respond_to?(:stats) server else require 'dalli' ::Dalli::Client.new(server, options) end end
Public Instance Methods
Source
# File lib/rack/cache/meta_store.rb, line 356 def purge(key) cache.delete(hexdigest(key)) nil end
Source
# File lib/rack/cache/meta_store.rb, line 345 def read(key) key = hexdigest(key) cache.get(key) || [] end
Source
# File lib/rack/cache/meta_store.rb, line 351 def write(key, entries, ttl = 0) key = hexdigest(key) cache.set(key, entries, ttl) end
Default TTL to zero, interpreted as “don’t expire” by Memcached.