# Cheetah.CacheStore module

Provides several CacheStore backends for Cheetah’s caching framework. The methods provided by these classes have the same semantics as those in the python-memcached API, except for their return values:

set(key, val, time=0)

  set the value unconditionally

add(key, val, time=0)

  set only if the server doesn’t already have this key

replace(key, val, time=0)

  set only if the server already have this key

get(key, val)

  returns val or raises a KeyError

delete(key)

  deletes or raises a KeyError

class Cheetah.CacheStore.AbstractCacheStore

  Bases: `object`

  add(key, val, time=None)
  delete(key)
  get(key)
  replace(key, val, time=None)
  set(key, val, time=None)

exception Cheetah.CacheStore.Error

  Bases: `Exception`

class Cheetah.CacheStore.MemcachedCacheStore(servers=None, debug=False)

  Bases: `AbstractCacheStore`

  add(key, val, time=0)
  clear()
  delete(key)
  get(key)
  replace(key, val, time=0)
  servers = '127.0.0.1:11211'
  set(key, val, time=0)

class Cheetah.CacheStore.MemoryCacheStore

  Bases: `AbstractCacheStore`

  add(key, val, time=0)
  clear()
  delete(key)
  get(key)
  replace(key, val, time=0)
  set(key, val, time=0)