drupal第三方缓存模块

drupal水滴 , 2012/03/05 11:59 ,
drupal建站 »
drupal模块 ,
评论(0) ,
阅读(821)
大 | 中 | 小 
第3方模块cacherouter (
http://drupal.org/project/cacherouter)就是一个利用fastpath模式的模块。假定你把这个模块安装在了sites/all/modules/contrib中。
由于fastpath在默认情况下不会创建数据库连接,所以要将所有的配置选项放在你的settings.php文件中:
$conf = array(
'page_cache_fastpath' => TRUE,
'cache_inc' => './sites/all/modules/contrib/cacherouter/cacherouter.inc',
... // More settings here.
);
数 组中的第一项,通过将page_cache_fastpath设置为TRUE来启用fastpath模式。这样就启用了fastpath模式,非常简单! 第2项用来声明Drupal将要加载的文件,将会使用这个文件来代替includes/cache.inc。在这种情况下,声明的文件就是 cacherouter模块将要使用的自定义缓存库。cacherouter模块还需要更多一点的配置;详细可参看
http://drupal.org /project/cacherouter。
如果你要加载自己的自定义缓存库,来代替Drupal默认使用的includes/cache.inc库,那么你需要编写你自己的cache_set(),cache_get()和cache_clear_all()函数。
注意 一旦启用了fastpath缓存,那么它将覆写在Drupal管理界面中设置的任意缓存选项。
来自
http://www.majormoves.net/post/1051/