【问题标题】:Caching whole html output with zend用zend缓存整个html输出
【发布时间】:2012-02-19 22:20:52
【问题描述】:

我正在尝试使用 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 代码应该保存在缓存文件夹中。

【问题讨论】:

    标签: zend-framework zend-cache


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2011-10-13
      • 2015-11-26
      • 2010-09-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-11
      相关资源
      最近更新 更多