ZF-9576: The output buffer clears too soon, resulting in empty cache files with Zend_Cache_Backend_Static

Issue Type: Bug Created: 2010-03-30T13:23:30.000+0000 Last Updated: 2010-04-05T16:52:32.000+0000 Status: Resolved Fix version(s): Reporter: Brandon Savage (brandonsavage) Assignee: Brandon Savage (brandonsavage) Tags: - Zend_Cache

Related issues: Attachments:


After following the directions in ZF-9148, cache files are being created, but are empty.

I have the following lines in my application.ini file:

<pre class="literal">
; Custom Caches (Adjustments To Default CacheManager) = APPLICATION_PATH "/../public/cached"
resources.cacheManager.pagetag.backend.options.cache_dir = APPLICATION_PATH "/../data/cache/tags"

The following is my controller:

<pre class="highlight">
class TestController extends Zend_Controller_Action
  public function init()
            $this->_helper->cache(array('index'), array('testentry'));


  public function indexAction()
    $this->view->testinfo = "Testing";

However, the files produced contain no data whatsoever. It appears that library/Zend/Controller/Dispatcher/Standard.php issues an ob_get_clean() command prior to the View actually being rendered.


Posted by Brandon Savage (brandonsavage) on 2010-04-02T13:33:56.000+0000

This issue is due to the fact that buffering must be turned off by the user with a param. A ticket (ZF-9600) has been filed to correct the code problem.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.