PHP code example of nguyenanhung / php-file-cache
1. Go to this page and download the library: Download nguyenanhung/php-file-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/ */
nguyenanhung / php-file-cache example snippets
guyenanhung\PhpFileCache\PhpFileCache;
$cache = new PhpFileCache();
$data = $cache->refreshIfExpired("simple-cache-test", function () {
return date("H:i:s"); // return data to be cached
}, 10);
echo "Latest cache save: $data";