Cache::Memcached::XS is a client library for memcached (memory cache daemon) using libmemcache.
SYNOPSIS
use Cache::Memcached::XS;
$memd = new Cache::Memcached {
'servers' => [ "10.0.0.15:11211", "10.0.0.15:11212",
"10.0.0.17:11211", [ "10.0.0.17:11211", 3 ] ],
'compress_threshold' => 10_000,
};
$memd->set_servers($array_ref);
$memd->set_compress_threshold(10_000);
$memd->enable_compress(0);
$memd->set("my_key", "Some value");
$memd->set("object_key", { 'complex' => [ "object", 2, 4 ]});
$val = $memd->get("my_key");
$val = $memd->get("object_key");
if ($val) { print $val->{'complex'}->[2]; }
$memd->incr("key");
$memd->decr("key");
$memd->incr("key", 2);
This is the Perl API for memcached, a distributed memory cache daemon. More information is available at:
http://www.danga.com/memcached/
This version differs from the original Cache::Memcached perl client in that it uses the libmemcache library and uses quite a lot less CPU.
A few features from the original client are not (yet) supported:
- no_rehash
- debug
- stats
- disconnect_all
Other than this, it should be pretty much a drop-in replacement for the original client.
Product's homepage
Requirements:
· Perl