语言选择
English 简体中文 繁体中文 UTF-8
系统导航
本站新闻 : xoops cache 更新 hack
作者 D.J. 于 2004年07月20日 22:42:40 (551 次阅读) 该作者发布的其他新闻

这是在xoops.org总站发布的一个hack
已经加入到xoops2.2中了
所以。。。没有必要再用了,等xoops2.2罢

总站告诉我原来的下载不能用了,让更新一下。我就顺便也放到这里罢

This is a revised download since the site url changed.
And it might be less vague if use the title of "cache on change"?
[July 20, 2004]

OBJECTIVES:
Make the cache system more flexible and more efficient
for different modules


HOWTO:
1 modify XOOPS_ROOT_PATH/kernel/module.php:
class XoopsModule extends XoopsObject
{
...
// clear module/block cache files
function clearCache()
{
// clear module cache files
// clear relevant block cache files
}

//Update the module cache
function updateCache()
{
$this->clearCache(); // clear module/block cache
files
// create module cache files TODO
// create block cache files DONE
}
}

2 call xoopsmodule::updatecache where necessary. For
instance, in the post.php of newbb module, add the
following right after notification handling:
global $xoopsModule; // not necessary for this
specific case
$xoopsModule->updateCache();

3 related configurations
(1) For a static module such as an article module, or a
dynamic module with no click or view stats: set the
relevant cache time parameters with a huge value, for
say 1 week, 1 month or even use cache_lifetime. In this
case, queries will only occur when new submission or
database update happens.

(2) For a dynamic module, such as forum: set relevant
cache time with a regular value. In this case, cache will
work in regular way if no update occurs but update can
take effect in real time once submission or update
happens.


4 BENEFITS
1 speed up xoops page loading by reducing queries

2 speed up xoops display update by using event-
triggered cache update


5 NOTE:
Alternatively, this hack can be made in
XOOPS_ROOT_PATH/class/template.php
as following:

1 update ROOT/class/template.php file

2 in corresponding module files, for instance:
ROOT/modules/newbb/post.php::
include_once XOOPS_ROOT_PATH . '/class/template.php';
...
just after $notification_handler->...
xoops_update_module_cache($xoopsModule);


HAS NOT BEEN FULLY TESTED YET.


more details available in case you are interested.



read the readme.txt plz.

评分: 0.00 (0 票) - 评分 -
上一篇 - 下一篇 打印模式 转发给朋友 生成该文件的PDF


其他文章
2005年12月06日 10:25:36 - XOOPS附加表情
2005年12月04日 11:30:00 - 北京地区XOOPS用户聚会
2005年11月28日 08:47:48 - 文章管理 Article 1.0 alpha 2 简体中文版 (测试版)
2005年11月19日 12:10:08 - 文章管理 Article 1.00 alpha测试版发布
2005年11月17日 23:20:36 - 外企招聘:Xoops 界面设计师 (兼职或全职)

网友个人意见,不代表本站立场。有问题请与作者联系。