Cache\Frontend\Json

Class Phalcon\Cache\Frontend\Json

implements Phalcon\Cache\FrontendInterface

Source on GitHub

Allows to cache data converting/deconverting them to JSON.

This adapter 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

<?php

// Cache the data for 2 days
$frontCache = new \Phalcon\Cache\Frontend\Json(
    [
        "lifetime" => 172800,
    ]
);

// Create the Cache setting memcached connection options
$cache = new \Phalcon\Cache\Backend\Memcache(
    $frontCache,