If true, ignores exceptions when gettings cached records (the memcached API).
The cache store object for the model, which should implement the Ruby-Memcache (or memcached) API
The time to live for the cache store, in seconds.
Delete the cached object with the given primary key.
# File lib/sequel/plugins/caching.rb, line 57 def cache_delete_pk(pk) cache_delete(cache_key(pk)) end
Return the cached object with the given primary key, or nil if no such object is in the cache.
# File lib/sequel/plugins/caching.rb, line 63 def cache_get_pk(pk) cache_get(cache_key(pk)) end
Return a key string for the given primary key.
# File lib/sequel/plugins/caching.rb, line 68 def cache_key(pk) raise(Error, 'no primary key for this record') unless pk.is_a?(Array) ? pk.all? : pk "#{self}:#{Array(pk).join(',')}" end
Set the time to live for the cache store, in seconds (default is 3600, # so 1 hour).
# File lib/sequel/plugins/caching.rb, line 76 def set_cache_ttl(ttl) @cache_ttl = ttl end