Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This project is not covered by Drupal’s security advisory policy.
Drupal PSR Cache
PSR compliant cache for Drupal using the Drupal cache API.
It contains a static cache proxy in order to stack cache pools together.
Install
- download the module
- run composer in the module folder:
composer update
- enable module
Usage
Fetching a cached item:
$cachePool = new \Drupal\PSRCache\CachePool();
$cacheItem = $cachePool->getItem('foo');
var_dump($cacheItem->get());
Setting an element:
$cachePool = new \Drupal\PSRCache\CachePool();
$cacheItem->set(['foo' => 'bar']);
$cachePool->save($cacheItem);
Using the static cache proxy:
$cachePool = new \Drupal\PSRCache\CachePool();
$staticCache = new \Drupal\PSRCache\StaticCacheProxy($cachePool);
$cacheItem = $staticCache->getItem('foo');
var_dump($cacheItem->get());
Supporting organizations:
Provided time and resource for development
Project information
- Module categories: Developer Tools
- 2 sites report using this module
- Created by itarato on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.