1. Go to this page and download the library: Download chillerlan/php-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/ */
chillerlan / php-cache example snippets
// Redis
$redis = new Redis;
$redis->pconnect('127.0.0.1', 6379);
$cache = new RedisCache($redis);
// Memcached
$memcached = new Memcached('myCacheInstance');
$memcached->addServer('localhost', 11211);
$cache = new MemcachedCache($memcached);
// APCU
$cache = new APCUCache;
// File
$cache = new FileCache(new CacheOptions(['cacheFilestorage' => __DIR__.'/../.cache']));
// Session
$cache = new SessionCache(new CacheOptions(['cacheSessionkey' => '_my_session_cache']));
// Memory
$cache = new MemoryCache;