Cache无法使用Action

Cache无法使用Action

本文介绍了Zend Cache无法使用Action Helper正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Zend Framework应用程序中实现全页静态缓存.通过将静态后端与Capture前端结合使用,可以缓存整个页面,并在以后由.htaccess重定向提供服务,直到删除/重新生成缓存为止.作为参考,我一直在使用 Zend_Cache_Backend_Static 手册中的内容,还提供了更多信息由班级作者.

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.

根据示例,我已经为缓存(静态HTML文件)及其标签配置了目录,并添加了以下行:

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'));

给我的一个控制器.

将在正确的位置创建HTML文件,并按预期方式创建标签.但是,HTMl文件始终为空白-0个字节.

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.

我无法诊断问题,也无法在线找到任何信息来提供帮助.据我所知,Output Buffering回调从Zend应用程序接收输出存在一些问题,但我不知道到底是什么问题.

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?

推荐答案

在挠头之后,我找到了答案:

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

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

...在应用程序INI文件中.

...in the application INI file.

这篇关于Zend Cache无法使用Action Helper正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 20:46