Cache component with PSR-6 and external cache libraries as providers

dev-master 2019-02-19 16:26 UTC

This package is auto-updated.

Last update: 2022-09-20 01:00:46 UTC


The PSR-16 cache component that wraps other external cache libraries. It gives you the opportunity to easily change the cache library in your applications.


Download SmartCache component via Composer:

composer require pawel-brzezinski/smart-cache-component

Supported cache libraries

Cache tags

SmartCache component provides tagging methods for cache item and cache pool for libraries which support tagging.


Tagging cache item

$cacheItem1 = $cache->getItem('foo');
$cacheItem1->setTags(['tag1', 'tag2']);

$cacheItem2 = $cache->getItem('bar');
$cacheItem2->setTags(['tag2', 'tag3']);


Invalidating cache by cache tags

// All cache keys tagged by "tag2" tag will be invalidated