Cache\Frontend\Json

Class Phalcon\Cache\Frontend\Json

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
 $ca