jrsaunders/quickcache

v1.0.6 2017-05-24 09:07 UTC

README

Quick Caching Library

Latest Stable Version Total Downloads Latest Unstable Version License

Install via composer

$composer require jrsaunders/quickcache

<?php

$setupCache = new \QuickCache\Cache();
$setupCache->setCachePath('/var/a/place/on/my/server/for/chachefiles');


$cache = new \QuickCache\Cache();
$cacheData = $cache->getCacheData('mycachefilename', 30);
if(!$cacheData){
    $cacheData = //get data from DB;
    $cache->saveToCache('mycachefilename', $cacheData);
}

// use the $cacheData somehow!