PHP code example of vpg / titon.cache

1. Go to this page and download the library: Download vpg/titon.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/ */

    

vpg / titon.cache example snippets


$cache = new Titon\Cache\Cache();
$cache->addStorage('memcache', new Titon\Cache\Storage\MemcacheStorage());
$cache->addStorage('fs', new Titon\Cache\Storage\FileSystemStorage());

$cache->set('foo', $data, '+1 hour', 'memcache');
$data = $cache->get('bar', 'fs');

$apc = new Titon\Cache\Storage\ApcStorage();
$apc->remove('foo');