0

我正在尝试使用 Zend_Cache 缓存布局脚本和控制器的操作脚本输出的所有内容,但它无法正常工作。我得到的只是

DEBUG HEADER:这是一个缓存页面!

我得到了 layout.phtml 脚本和 index.phtml 脚本。两者都产生html代码。在我的 IndexController 我放

        $frontendOptions = array(
       'lifetime' => 7,
       'debug_header' => true,
       'regexps' => array(
           '^/$' => array('cache' => true),
           '^/index/' => array('cache' => true)
       )
    );

    $backendOptions = array('cache_dir' => '../application/cache/');

    $cache = Zend_Cache::factory('Page', 'File', $frontendOptions, $backendOptions);

    if(!$cache->start('mypage')) {
    }

如何让它工作?我希望 html 代码应该保存在缓存文件夹中。

4

1 回答 1

1

查看Zend Cache 上 Brandon Savage 的本教程,它很短,我认为它比 ZF 文档更新。

于 2012-02-20T04:11:40.583 回答