1. Go to this page and download the library: Download nilportugues/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/ */
nilportugues / cache example snippets
NilPortugues\Cache\Adapter\MemcachedAdapter;
use NilPortugues\Cache\Adapter\PredisAdapter;
use NilPortugues\Cache\Cache;
$parameters = ameters['memcached']['persistent_id'],
$parameters['memcached']['connections']
);
);
return [
'user_cache' => new Cache($cache, 'user', 60*5), //5 minutes cache
'image_cache' => new Cache($cache, 'image', 60*60), //1 hour cache
];