nicholasruunu / hierarchical-cache

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hierarchical PSR-6 cache pool

Build Status codecov.io

This is a implementation for the PSR-6 for an hierarchical cache architecture.

If you have a cache key like |users|:uid|followers|:fid|likes where :uid and :fid are arbitrary integers. You may flush all followers by flushing |users|:uid|followers.

$user = 4711;
for ($i = 0; $i < 100; $i++) {
  $item = $pool->getItem(sprintf('|users|%d|followers|%d|likes', $user, $i));
  $item->set('Justin Bieber');
  $pool->save($item);
}

$pool->hasItem('|users|4711|followers|12|likes'); // True

$pool->deleteItem('|users|4711|followers');

$pool->hasItem('|users|4711|followers|12|likes'); // False
Feature Supported
Flush everything Yes
Expiration time Yes
Tagging Yes

About

License:MIT License


Languages

Language:PHP 100.0%