问题
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?
回答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.
来源:https://stackoverflow.com/questions/2411080/zend-cache-not-working-using-action-helper