我正在使用zend frameword 1.11版
我的网站使用 memcache 来保存会话,但想使用更多的 zend 缓存页面来缓存页面 html
结果:缓存页面 html没有保存正确的缓存目录配置,它保存公共路径并且文件中的数据为空(0 KB)
成为兄弟帮助
我在application.ini中的配置
; MEMCACHE CONFIG
resources.cachemanager.memcached.frontend.name = Core
resources.cachemanager.memcached.frontend.options.automatic_serialization = On
resources.cachemanager.memcached.backend.name = Memcached
resources.cachemanager.memcached.backend.options.servers.one.host = 10.60.80.51
resources.cachemanager.memcached.backend.options.servers.one.port = 11211
resources.cachemanager.memcached.backend.options.servers.one.persistent = On
; session savehandler class
resources.session.name = PHPGAME1_SESSION
resources.session.saveHandler.class = Zend_Session_SaveHandler_Cache
resources.session.gc_maxlifetime = 7200
resources.session.cookie_domain = ".game5.vn"
;cofig cache page
resources.cacheManager.page.backend.options.public_dir = PUBLIC_PATH "/cached"
resources.cacheManager.pagetag.backend.options.cache_dir = WEB_PATH "/data/cache/tags"
resources.frontController.params.disableOutputBuffering = true
resources.cacheManager.page.backend.options.disable_caching = false
我对初始化会话处理程序的引导
protected function _initSessionId()
{
$opts = $this->getOptions();
if (isset($opts['resources']['session']['saveHandler']['class']) &&
'Zend_Session_SaveHandler_Cache' == $opts['resources']['session']['saveHandler']['class']) {
$this->bootstrap('session');
$cache = $this->bootstrap('cachemanager')
->getResource('cachemanager')
->getCache('memcached');
Zend_Session::getSaveHandler()->setCache($cache);
}
$defaultNamespace = new Zend_Session_Namespace();
if (!isset($defaultNamespace->initialized)) {
Zend_Session::regenerateId();
$defaultNamespace->initialized = true;
}
}
在初始化控制器中,我使用助手来保存缓存页面,想要保存缓存页面的操作
$this->_helper->cache(array('index'), array('content'));
非常感谢