Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Caching library for PHP 5.3+
branch: master
Failed to load latest commit information.
docs renamed lib to src
examples replaced profiler with monolog support
tests added unit tests
.travis.yml added unit tests
LICENSE Added license file and renamed docs file replaced profiler with monolog support
composer.json removed version from composer.json
phpunit.xml.dist added unit tests


Caching framework for PHP 5.3+

Build Status


  • Easy retreival and storing of key, value pairs using the many available methods
  • Cache function calls
  • Available object wrapper to cache calls to methods
  • Pipelines ala Predis (see below)
  • Namespaces
  • TTL variations to avoid all caches to expire at the same time
  • Multiple backends support (apc, file, memcache(d), memory, redis, session)
  • Monolog support
  • Very well documented

CacheCache features are exposed through a Cache object which itself uses backends to store the data. Multiple instances of Cache objects can be managed using the CacheManager.

Full documentation at


$cache = new CacheCache\Cache(new CacheCache\Backends\Memory());

if (($foo = $cache->get('foo')) === null) {
    $foo = 'bar';
    $cache->set('foo', $foo);

if (!$cache->start('foo')) {
    echo "bar\n";

$cache->call('sleep', array(2));
$cache->call('sleep', array(2)); // won't sleep!

$r = $cache->pipeline(function($pipe) {
    $pipe->set('foo', 'bar');
    $pipe->set('bar', 'foo');
    $pipe->set('foo', 'foobar');

More examples in examples/

Something went wrong with that request. Please try again.