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


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:

; Custom Caches (Adjustments To Default CacheManager)
resources.cacheManager.page.backend.options.public_dir = APPLICATION_PATH "/../public/cached"
resources.cacheManager.pagetag.backend.options.cache_dir = APPLICATION_PATH "/../data/cache/tags"

The following is my controller:

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.


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.