Caching whole html output with zend

人盡茶涼 提交于 2019-12-12 02:48:48

问题


I am trying to cache everything that is output by layout script and controller's action script using Zend_Cache but it is not working correctly. All I get is

DEBUG HEADER : This is a cached page !

I got layout.phtml script and index.phtml script. Both produce html code. In my IndexController i put

        $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')) {
    }

How to get it working? I expect that html code should be saved in cache folder.


回答1:


check this tutorial out Brandon Savage on Zend Cache, it's short and I think it's more current then the ZF docs.



来源:https://stackoverflow.com/questions/9353845/caching-whole-html-output-with-zend

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