Class Ramaze::Cache::MemCache
In: lib/ramaze/cache/memcache.rb
Parent: Object

Cache based on the memcache library which utilizes the memcache-daemon to store key/value pairs in namespaces.

Please read the documentation of memcache-client for further methods.

It is highly recommended to install memcache-client_extensions for a bit of speedup and more functionality

NOTE: There is a big issue with persisting sessions in memcache, not only

      can they be dropped at any time, essentially logging the user out
      without them noticing, but there is also a low limit to the maximum
      time-to-live. After 30 days, your session will be dropped, no
      matter what.
      Please remember that memcache is, first of all, a cache, not a
      persistence mechanism.

NOTE: If you try to set a higher ttl than allowed, your stored key/value

      will be expired immediately.

Methods

Included Modules

Cache::API

Constants

MAX_TTL = 2592000
OPTIONS = { :multithread => true, :readonly => false, :servers => ['localhost:11211:1'], }   +:multithread+: May be turned off at your own risk.
   +:readonly+: You most likely want that to be false.
    +:servers+: Array containing at least one of:
                MemCache::Server instance
                Strings like "localhost", "localhost:11211", "localhost:11211:1"
                That accord to "host:port:weight", only host is required.

Public Instance methods

Wipe out all data in memcached, use with care.

NOTE:

  * We have no way of knowing whether the value really is nil, we
    assume you wouldn't cache nil and return the default instead.

state of compression (true/false)

For everything else that we don‘t care to document right now.

switch to different namespace

statistics about usage

[Validate]