美好的一天,Zend_Cache_Frontend_Page没有缓存(没有工作)
我遇到了Zend_Cache_Frontend_Page中的一些问题。我想使用Zend_Cache_Frontend_Page来缓存一些页面。但它不起作用。
protected function _initBookPageCaching()
{
Zend_Controller_Front::getInstance()->setParam('disableOutputBuffering',true);
// cache book pages
$frontendOptionsPages = array(
'lifetime' => 2592000,
'debug_header' => true, // for debugging
'regexps' => array(
// cache the whole IndexController
'^/$' => array('cache' => true),
'^/download-free-ebook/.*' => array('cache' => true)
)
);
$backendOptionsPages = array(
'cache_dir' => APPLICATION_PATH.'/../cache'
);
$cacheBookPages = Zend_Cache::factory(
'Page',
'File',
$frontendOptionsPages,
$backendOptionsPages);
$cacheBookPages->start();
}
我把上面的方法设置成Bootstrap.php文件。
请帮我解决这个问题。
感谢您的提前。
它是否在缓存目录中创建文件?这将告诉我们缓存是否被首先创建,更不用说被使用了。 –
不,它不会创建任何文件 – Mirodil
好了,疑问,什么是APPLICATION_PATH设置为?试试'echo APPLICATION_PATH。 '/../cache';'并显示结果。 –