Hi All,
I've just started using Zend Cache. I am trying to store an entire HTML in the cache, however it is not storing anything. Here is my code, any help much appreciated.
<?php
include_once "Zend/Cache.php";
include_once 'f1.php';
$frontendOptions = array('lifetime' => 6,'automatic_serialization' => true);
$backendOptions = array('cache_dir' => '/tmp/');
$cache = Zend_Cache::factory('Output', 'File', $frontendOptions, $backendOptions);
$pageid = 'MYTEST';
ZendCacheData($pageid);
/******************* ZEND CACHE FUNCTIONS *****************************/
function ZendCacheData( $pageid )
{
global $cache;
if (!($cache->test($pageid)))
{
// ShowMainMarkets1() Function returns an HTML paqe
$returnData = ShowMainMarkets1();
$cache->save( $returnData, $pageid );
} else {
$returnData = $cache->load($pageid);
$returnData = $returnData;
}
echo $returnData;
}
?>