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 7035413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:18:05+00:00 2026-05-28T01:18:05+00:00

I am trying to fiddle around with Zend_Cache, so I added following code to

  • 0

I am trying to fiddle around with Zend_Cache, so I added following code to my action (will be moved to bootstrap later, I guess):

$frontendOptions = array(
    'lifetime' => 7200,
    'debug_header' => true, // für das Debuggen
    'default_options' => array(
        'cache' => true,
        'cache_with_get_variables' => true,
        'cache_with_session_variables' => true,
        'cache_with_cookie_variables' => true,
        'cache_with_post_variables' => true,
    )
);

$backendOptions = array(
    'cache_dir' => '/tmp/'
);

$cache = Zend_Cache::factory('Page', 'File',
    $frontendOptions, $backendOptions
);
echo "hej";
var_dump($cache->start('someid'));

Zend generates a cache file containing hejbool(false) now, but apart from that it does not cache my page. According to a German book about zend framework, false is correct when there is no cache available. true is only returned when a cache was found.

When I debugged within Zend_Cache_Frontend_Page.php directly, it went down to the bottom of the start()-method, meaning that nothing went wrong (id given) and no cache was found, so one had to be generated. This was done (I can see it in /tmp/), but without the needed content.

So why does not not cache the output from Zend_View, but only direct output via echo?

I do not call any explicit function to render the view, but this did not seem necessary anymore (my views are always rendered automatically according to controller and action). I tried it for both a standard XHTML template (index.phtml) and an RSS template (index.rss.phtml).

Any ideas? Do you need any other code fragments?

  • 1 1 Answer
  • 0 Views
  • 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-28T01:18:06+00:00Added an answer on May 28, 2026 at 1:18 am

    When using the Zend_Cache_Frontend_Page you have to enable the disableOutputBuffering option. The reason is that Zend_Cache_Frontend_Page uses ob_start with a callback and it has to be the first call to ob_start otherwise it leads to that strange behaviour you’ve encountered.

    To enable it you can either set it in your Bootstrap with

    Zend_Controller_Front::getInstance()->setParam('disableOutputBuffering', true);
    

    or using the configuration file after your frontController-setup (here in the INI-style configuration):

    resources.frontController.params.disableOutputBuffering = true
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to fiddle around with this concept and I can't seem to get
I'm a JSON noob and trying to fiddle around with the open table of
I am new to three20. I was trying to fiddle around with Launcher. I
im really interested in airBNB search page, im trying to fiddle around with the
I am new to Haskell and trying to fiddle with some test cases I
Trying to make a MySQL-based application support MS SQL, I ran into the following
Trying to create a QtRuby application, I get the following error: /usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation
For a pet project I started to fiddle with ANTLR. After following some tutorials
Probably a stupid question but I'm still trying to wrap my head around nHibernate.
I am trying to wrap my head around the process of oAuth for a

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.