php - use memcache for fragment cache -


how use memcache fragment cache? use zend framework libraries. see exapmle.

require_once 'zend/cache.php'; $frontendoptions = array(     'lifetime' => 300,     'automatic_serialization' => false ); $backendoptions = array('cache_dir' => './zendcache/');  $cache = zend_cache::factory('output', 'file', $frontendoptions, $backendoptions);  if (!$cache->start('rightcolumn')) {     // html , cached in file.      $cache->end(); } 

now want use memcache fragment cache.

require_once 'zend/cache.php'; $frontend = array('caching' => true, 'lifetime' => 1800, 'automatic_serialization' => true);  $backendoptions = array('cache_dir' => './zendcache/'); $backend = array(     'servers' => array(         array('host' => '127.0.0.1', 'port' => 11211)     ),     'compression' => false ); $cache = zend_cache::factory('core', 'memcached', $frontend, $backend); $key = 'cachekey'; if (($result = $cache->load($key)) === false) {     $cache->save($result, $key); } echo $result; 

how solve ?


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -