Skip to content
This repository was archived by the owner on May 16, 2018. It is now read-only.
This repository was archived by the owner on May 16, 2018. It is now read-only.

Zend_Cache_Frontend_Page bug #106

@PavelPolyakov

Description

@PavelPolyakov

Trying to have the cache for the page despite of cookies, get, post and other variables.
Like this:

$frontendOptions = array(
'lifetime' => 3600,
'debug_header' => false, // for debugging
'default_options' => array(
'cache' => false,
'cache_with_files_variables' => false,
'cache_with_get_variables' => false,
'cache_with_post_variables' => false,
'cache_with_cookie_variables' => false
),
'regexps' => array(
'^/$' => array('cache' => true),
'^/about$' => array('cache' => true),
'^/faq$' => array('cache' => true),
'^/price$' => array('cache' => true),
)
);

Would fail when you have cookies, because of the
protected function _makePartialId($arrayName, $bool1, $bool2) function.

And this part:

   if (count($var) > 0) {
       return false;
   }

The _makePartialId function would return false, the cache key would not be generated, the cache would not be stored.

The possible solution is using the next configuration values in the $frontendOptions:

           'cache_with_cookie_variables' => true,
           'make_id_with_cookie_variables' => false

So it would escape the function before that check.

I don't know the real purpose of the check, so I can't simply remove it and commit.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions