Zend Cache not working using Action Helper
Asked Answered
S

1

1

I'm trying to implement full page static caching in my Zend Framework application. Using the Static backend coupled with the Capture frontend, whole pages can be cached, and served by a .htaccess redirect in the future, until the cache is deleted/regenerated. For reference, I've been using the section on Zend_Cache_Backend_Static in the manual, and also some further information provided by the class author.

As per the example, I have configured the directories for the cache (static HTML files) and their tags, and I have added the line:

$this->_helper->cache(array('index'), array('allentries'));

to one of my controllers.

The HTML file is created in the correct place, and the tags are also created as expected. However, the HTMl file is always blank - 0 bytes.

I can't diagnose the problem, and I can't find any information online to help. As far as I can see it's some problem with the Output Buffering callback which receives the output from the Zend app, but I don't know precisely what's wrong.

Can anybody shed some light on the issue?

Sleeper answered 9/3, 2010 at 17:30 Comment(1)
It seems as if the ob_start callback function is being passed an empty string every time. If I append the string 'test' to the data inside the Zend_Cache_Frontend_Capture::_flush method, only the string 'test' is written to the HTML file. Any idea why the callback isn't receiving the HTML contents of the generated page?Sleeper
S
1

After a lot of head scratching, I found the answer:

; required for page caching
resources.frontController.params.disableOutputBuffering = true

...in the application INI file.

Sleeper answered 10/3, 2010 at 14:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.