extends class Phalcon\Cache\Frontend\Data
implements Phalcon\Cache\FrontendInterface
Allows to cache data converting/deconverting them to JSON. This adapters uses the json_encode/json_decode PHP’s functions As the data is encoded in JSON other systems accessing the same backend could process them
// Cache the data for 2 days $frontCache = new Phalcon\Cache\Frontend\Json(array( "lifetime" => 172800 )); //Create the Cache setting memcached connection options $cache = new Phalcon\Cache\Backend\Memcache($frontCache, array( 'host' => 'localhost', 'port' => 11211, 'persistent' => false )); //Cache arbitrary data $cache->save('my-data', array(1, 2, 3, 4, 5)); //Get data $data = $cache->get('my-data');
Serializes data before storing it
Unserializes data after retrieving it
Phalcon\Cache\Frontend\Data constructor
Returns cache lifetime
Check whether if frontend is buffering output
Starts output frontend. Actually, does nothing
Returns output cached content
Stops output frontend
© 2011–2016 Phalcon Framework Team
Licensed under the Creative Commons Attribution License 3.0.
https://docs.phalconphp.com/en/2.0.0/api/Phalcon_Cache_Frontend_Json.html