Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

jifty::dbi::record::memcached(3pm) [debian man page]

Jifty::DBI::Record::Memcached(3pm)			User Contributed Perl Documentation			Jifty::DBI::Record::Memcached(3pm)

NAME
Jifty::DBI::Record::Memcached - records with caching behavior SYNOPSIS
package Myrecord; use base qw/Jifty::DBI::Record::Memcached/; DESCRIPTION
This module subclasses the main Jifty::DBI::Record package to add a caching layer. The public interface remains the same, except that records which have been loaded in the last few seconds may be reused by subsequent get or load methods without retrieving them from the database. METHODS
load_from_hash Overrides the implementation from Jifty::DBI::Record to add support for caching. load_by_cols Overrides the implementation from Jifty::DBI::Record to add support for caching. _cache_config You can override this method to change the duration of the caching from the default of 5 seconds. For example, to cache records for up to 30 seconds, add the following method to your class: sub _cache_config { { 'cache_for_sec' => 30 } } memcached_config Returns a hash containing arguments to pass to Cache::Memcached during construction. The defaults are like: ( services => [ '127.0.0.1:11211' ], debug => 0, ) You may want to override this method if you want a customized cache configuration: sub memcached_config { ( servers => [ '10.0.0.15:11211', '10.0.0.15:11212', '10.0.0.17:11211', [ '10.0.0.17:11211', 3 ] ], debug => 0, compress_threshold => 10_000, ); } cache_key_prefix Returns the prefix we should prepend to all cache keys. If you're using one memcached for multiple applications, you want this to be different for each application or they might end up mingling data. AUTHOR
Matt Knopp <mhat@netlag.com> SEE ALSO
Jifty::DBI, Jifty::DBI::Record perl v5.14.2 2010-09-21 Jifty::DBI::Record::Memcached(3pm)

Check Out this Related Man Page

Jifty::CAS::Store::Memcached(3pm)			User Contributed Perl Documentation			 Jifty::CAS::Store::Memcached(3pm)

NAME
Jifty::CAS::Store::Memcached - A memcached backend for Jifty's Content-Addressable Storage facility SYNOPSIS
At the bare minimum, add the following to your Jifty config.yml: framework: CAS: BaseClass: 'Jifty::CAS::Store::Memcached' The options available include: framework: CAS: BaseClass: 'Jifty::CAS::Store::Memcached' Memcached: # any options Cache::Memcached supports servers: - 10.0.0.2:11211 - 10.0.0.3:11211 compress_threshold: 5120 # Turned on by default. Keeps CAS working when memcached fails by # falling back to the default in-process store. It probably should # be turned off in most cases (like so) after successful testing. MemcachedFallback: 0 DESCRIPTION
This is a memcached backend for Jifty::CAS. For more information about Jifty's CAS, see "DESCRIPTION" in Jifty::CAS. METHODS
memcached Returns the Cache::Memcached object for this class. _store DOMAIN NAME BLOB Stores the BLOB (a Jifty::CAS::Blob) in memcached. Returns the key on success or undef on failure. key DOMAIN NAME Returns the most recent key for the given pair of "DOMAIN" and "NAME", or undef if none such exists. retrieve DOMAIN KEY Returns a Jifty::CAS::Blob for the given pair of "DOMAIN" and "KEY", or undef if none such exists. memcached_config Returns a hashref containing arguments to pass to Cache::Memcached during construction. The defaults are like: { servers => [ '127.0.0.1:11211' ], debug => 0, namespace => Jifty->config->framework('ApplicationName'), compress_threshold => 10240, } To change these options, set them in your Jifty application config file under "/framework/CAS/Memcached" like so: framework: CAS: BaseClass: 'Jifty::CAS::Store::Memcached' Memcached: servers: - 10.0.0.2:11211 - 10.0.0.3:11211 compress_threshold: 5120 memcached_fallback Returns a boolean (from the config file) indicating whether or not memcached should fallback to the per-process, in-memory store. perl v5.14.2 2010-12-08 Jifty::CAS::Store::Memcached(3pm)
Man Page