PHP code example of xes / pcache
1. Go to this page and download the library: Download xes/pcache 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/ */
xes / pcache example snippets
$predis = new Predis\Client();
$cache = new xes\Pcache($predis);
$keyname = 'someKey';
$TTL = 60;
echo $cache->get($keyname, $TTL, function() {
// Some slow function such as a database call
sleep(1);
return 'hello world';
});