jrsaunders/quickcache

Quick Caching

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

This package is not auto-updated.

Last update: 2024-11-10 05:08:58 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!