Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 804471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:55:31+00:00 2026-05-14T23:55:31+00:00

I am using Zend Cache with page caching but it seems to miss the

  • 0

I am using Zend Cache with page caching but it seems to miss the cache after a period of time. For a while it is OK, but I come back tomorrow and hit the page, it doesn’t fetch the contents from the cache. why?

$frontendOptions = array(
    'content_type_memorization' => true, // This remembers the headers, needed for images
   'lifetime' => NULL,                   // cache lifetime forever
   'automatic_serialization' => true,
   'automatic_cleaning_factor' => 0
);

$myPageCache = new Zend_Cache_Frontend_Page(array(
    'debug_header' => false,
    'automatic_cleaning_factor'=>0,
    'content_type_memorization' => true,
    'default_options'           => array(
    'cache' => true,
    'cache_with_get_variables' => true,
    'cache_with_post_variables' => true,
    'cache_with_session_variables' => true,
    'cache_with_cookie_variables' => true
    )));


$backendOptions = array('cache_dir' => '.' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR);

$cache = Zend_Cache::factory($myPageCache,
                             'File',
                             $frontendOptions,
                             $backendOptions);

$cacheKey = hash('md5', "cache_" . $cachePath); // cachePath is the key I use for the cache

if(!$cache->start($cacheKey)) {
I output html here
 $cache->end();
}
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T23:55:32+00:00Added an answer on May 14, 2026 at 11:55 pm

    Indeed. My read of the static method

    Zend_Cache::factory($frontend, $back, $frontendOptions, $backendOptions, ...) 
    

    is that the $frontendOptions are used only when you pass a string for the $frontend parameter. When you pass a concrete instance as you are doing, the $frontendOptions are ignored.

    If you still want to pass a concrete instance $myPageCache into the factory, then it seems like you need to pass the lifetime parameter (and the others) into the call that creates the instance. Otherwise, you could load up a single $frontendOptions array and use:

    $cache = Zend_Cache::factory('Page', 'File', $frontendOptions, $backendOptions);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Zend Paginator and the paginator cache works fine, but the same cached pages
I'm looking for solution for a in memory script cache, using Zend_Cache and zend
I've just set up static page caching using Zend_Cache_Backend_Static to serve cached html files
I'm trying to implement a cache using Zend Cache. I use the following code
I am using Zend Studio 8.0 for Mac, every time I start to type
I started using Zend Cache (APC backend) and all is well in terms of
I'm thinking of using two level cache backend, in a Zend Framework application. Fast:
I created a site a while ago using zend and smarty. The site is
Using Zend FW based Youtube api. Often getting errors on page load Fatal error:
Using Zend Framework, I've created a Model to insert a record into a database.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.