Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 524 Bytes

README.md

File metadata and controls

25 lines (18 loc) · 524 Bytes

Cache Helper

Wrapper for 10up's Async Transients library.

NOTE: run composer install before running, put this in your plugins directory and enable it

Rudimentary sample usage:

$function = function ($value){
	sleep( 2 );
	// long running API call
	return $value . time();

};

$async = new Cache( 'mycachekey123', 'bar', 20, $function, array('prefix') );

$before = microtime(true);
$val = $async->get();
var_dump($val);
echo '<BR>';
echo microtime(true)-$before;