PHP code example of super-simple / cache
1. Go to this page and download the library: Download super-simple/cache library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
super-simple / cache example snippets
SSCache\Cache;
$cacheService = new Cache(new YourStorage());
// Adding a Serializer.
// The CacheSerializeDelegator uses default php serializer.
// For better performance could be added msgpack or igbinary.
$cacheSerializer = new CacheSerializeDelegator($cache);
// A CackeKeyDelegator must be the last one to handle key validation first
$cache = new CacheKeyDlelegator($cacheSerializer);
// Set the value
$cache->set($key, $value, $ttl);
// Get the value
$result = $cache->get($key);