1. Go to this page and download the library: Download galancev/smart-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/ */
galancev / smart-cache example snippets
use Components\Cache\SmartCache;
$cache = (new SmartCache())
->setGroup('test')
->setKey('supertest1')
->setExpire(5)
->get();
if ($cache->hasResult()) {
$need = $cache->getResult();
} else {
$need = rand(0, 666);
$cache->set($need);
}
Dev::pre($need);