Class Merb::Cache::MemcachedStore
In: lib/merb-cache/stores/fundamental/memcached_store.rb
Parent: AbstractStore

Memcached store uses one or several Memcached servers for caching. It‘s flexible and can be used for fragment caching, action caching, page caching or object caching.

Methods

clone   connect   delete   delete_all   exists?   expire_time   fetch   new   normalize   read   writable?   write  

Attributes

memcached  [RW] 
namespace  [RW] 
servers  [RW] 

Public Class methods

Public Instance methods

Establishes connection to Memcached.

Use :buffer_requests option to use bufferring, :no_block to use non-blocking async I/O.

Deletes entry from cached by key.

Flushes the cache.

returns true/false/nil based on if data identified by the key & parameters is persisted in the store.

With Memcached 1.2 protocol the only way to find if key exists in the cache is to read it. It is very fast and shouldn‘t be a concern.

Returns expiration timestamp if :expire_in key is given.

Fetches cached data by key if it exists. If it does not, uses passed block to get new cached value and writes it using given key.

Returns cache key calculated from base key and SHA2 hex from parameters.

Reads key from the cache.

Memcached store consideres all keys and parameters writable.

Writes data to the cache using key, parameters and conditions.

[Validate]