Hi

 

I don’t get the expected behaviour with Zend_Cache_Frontend_Page.

 

If I want to cache my website frontpage (or other pages in future), I’ve put
this piece of code In my bootstrap file:

 

$frontendOptions = array(

'lifetime' => 7200,

      'debug_header' => true,            

      'automatic_serialization' => true,

      'default_options' => array('cache' => false),

      'regexps' => array(

            '^/' => array('cache' => true),

            '^/library/files' => array('cache' => true),

      ),

);

 

$backendOptions['cache_dir'] = $path . 'var/cache';

 

$pageCache = Zend_Cache::factory('Page', 'File', $frontendOptions,
$backendOptions);        

$pageCache->start();

 

 

As you can see, there are no additional options. I’m disabling automatic
caching for all pages except the two ones (root page and another action)
contained in the ‘regexps’ array. In this case I don’t won’t to cache based
in GET, POST or other global variables.

 

When the cache object checks for an ID, it always returns false because the
$_SESSION array is always filled with the PHPSESSID var, so the count
function result is always > 0 and returns false (line 292), breaking the
flow of “_makeId” function.

 

I’ve seen an open bug in Jira, but this case seems strange to me because
Fabien Marty says this is not a bug.

 

How should I write the code to expect this?

 

Thanks


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.11/1244 - Release Date: 25/01/2008
19:44
 

Reply via email to