Cache\Backend\Xcache

Class Phalcon\Cache\Backend\Xcache

extends abstract class Phalcon\Cache\Backend

implements Phalcon\Cache\BackendInterface

Allows to cache output fragments, PHP data and raw data using an XCache backend

//Cache data for 2 days
$frontCache = new Phalcon\Cache\Frontend\Data(array(
    'lifetime' => 172800
));

  $cache = new Phalcon\Cache\Backend\Xcache($frontCache, array(
      'prefix' => 'app-data'
  ));

//Cache arbitrary data
$cache->save('my-data', array(1, 2, 3, 4, 5));

//Get data
$data = $cache->get('my-data');

Methods

public __construct (登录查看完整内容