PHP code example of koded / cache-extended
1. Go to this page and download the library: Download koded/cache-extended 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/ */
koded / cache-extended example snippets
$cache = CachePool::use('redis');
$item = $cache->getItem('fubar');
$item->set('some value');
$item->expiresAfter(new DateTime('3 days'));
$cache->save();
/** $var Koded\Caching\Cache $client */
$client = $cache->client();
$cache->saveDeferred($event);
$cache->saveDeferred($counter);
// ... do some stuff
// store this now
$cache->save($dependency);
// ... do more stuff
$cache->saveDeferred($updates);
$cache->saveDeferred($extras);
// Store all deferred items
$cache->commit();