$cache = new Cache(
'/your/path/to/the/cahe-file/cache.db4', 'db4'
);
$yorObject = new ObjectYouWantToPutInCache();
$yourObjectIdentifier = 'your:cool:object:identifier';
// check if your object is in the cache.
// you also can ignore it, and let the CacheDba do it for you.
if (false == $cache->has($yourObjectIdentifier)) {
$cache->delete($yourObjectIdentifier);
}
$cache->put($yourObjectIdentifier, $yorObject);
// than somewhere at your project.
$cache->get($yourObjectIdentifier);
// for the garbage collection
// you can create an cron-job starting once a day.
$sweeper = new Sweeper($cache);
$sweeper->cleanAll();
// or clean all objects older than given expiration since now.
$sweeper->cleanOld();
Leia mais http://gjerokrsteski.github.com/php-dba-cache/