Zend Cache not working using Action Helper

梦想的初衷 提交于 2019-12-24 07:56:54

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!