Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  GANTRY::PLUGINS::CACHE::MEMCACHED (3)

.ds Aq ’


Gantry::Plugins::Cache::Memcached - A Plugin interface to a caching subsystem



It is sometimes desirable to cache data between page acceses. This module gives access to the Cache::Memcached module to store that data.

    # ...
    use MyApp qw{ -Engine=CGI -TemplateEngine=TT Cache::Memcached };


This plugin mixes in methods to store data within a cache. This data is then available for later retrival. Data is stored within the cache by key/value pairs. There are no restrictions on what information can be stored. This cache is designed for short term data storage. Cached data items will be timed out and purged at regular intervals. The caching system also has the concept of namespace. Namespaces are being used to make key’s unique. So you may store multiple unique data items within the cache.


The following items can be set by configuration:

 cache_rehash              wither to attempt a failover to another server
 cache_expires             the expiration of items within the cache
 cache_servers             which cache servers to use
 cache_compress_threshold  the threshold to start compression

The following reasonable defaults are being used for those items:

 cache_rehash              no
 cache_expires             3600 seconds
 cache_compress_threshold  1000 bytes

Since this cache is being managed by Cache::Memcached, any changes to those defaults should be consistent with that modules usage.


cache_init This method will initialize the cache. It should be called only once within the application.


cache_inited For internal use.

Dual use accessor for init flag. If cache_init has run this attribute is 1, otherwise it’s 0.

cache_namespace This method will get/set the current namespace for cache operations.


cache_handle This method returns the handle for the underlining cache. You can use this handle to manipulate the cache directly. Doing so will be highly specific to the underling cache handler.

 $handle = $self->cache_handle();

cache_purge Equivalent to


This method is for other cache plugins which support a purge method.

cache_get This method returns the data associated with the current namespace/key combination.

 $data = $self->cache_get($key);

cache_set This method stores the data associated with the current namespace/key combination.

 $self->cache_set($key, $data);

cache_keys This method is currently not available with memcached.
cache_clear This method will clear the entire cache.


cache_del This method removes the data associated with the current namespace/key combination.


cache_expires Retrieves the current expiration time for data items with thecache. The expiration time can be changed for this module. It is adviseable to not do so. Expiration time formats are highly specific to the underlining cache handler.

 $expiration = $self->cache_expires();




Kevin L. Esteb <>, Tim Keefer <>


Copyright (C) 2007 Kevin L. Esteb

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.

Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 GANTRY::PLUGINS::CACHE::MEMCACHED (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.