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

cache_clear cache_delete cache_fetch cache_setup cache_store compression compression= method_missing namespace namespace= stats

### 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

cache_clear()

Wipe out all data in memcached, use with care.

cache_delete(*keys)
cache_fetch(key, default = nil)

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.

cache_setup(host, user, app, name)

Connect to memcached

cache_store(key, value, options = {})
compression()

state of compression (true/false)

compression=(bool)

turn compression on or off

method_missing(*args, &block)

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

namespace()

current namespace

namespace=(ns)

switch to different namespace

stats()

statistics about usage

[Validate]