2007-08-30
推荐一个Javascript LRU Cache 对象。
关键字: ajax javascript cache
http://www.monsur.com/projects/jscache/
这个js cache不错。 功能也比较全。在项目中用它来缓存些大计算量的javascript json 对象。
这个js cache不错。 功能也比较全。在项目中用它来缓存些大计算量的javascript json 对象。
Cache cache = new Cache(200);
function reloadTagCloud() {
if (startDate != null && endDate != null) {
showIndicator();
var result = null;
if (tagSource == "Directory"){
result = cache.getItem("Directory" + startDate + endDate);
}
if (result != null){
processTagResult(result);
hideIndicator();
return ;
}
jsonrpc.subscribe.getTags(getTagsCallback, startDate, endDate, tagSource, 'frequency' /*tagOrder, should sort the top 20 locally, always use frequency on server side.*/);
}
}
function getTagsCallback(result, exception) {
if (exception) {
showError("An error has occurred: " + exception.message);
} else {
if (tagSource == "Directory"){
cache.setItem("Directory" + startDate + endDate, result);
}
processTagResult(result);
}
hideIndicator();
}
function processTagResult(result){
tagCloud.viewTags = result.sort(sortByFrquency);
tagCloud.setTagFontSizes();
updatTagCloudViewByOrder();
try {
dojo.byId("tagsButton").focus();
} catch (e) {}
}
评论
dengyin2000
2007-12-27
carrot 写道
good
carrot
your colleague
carrot
your colleague
萝卜 你的处女贴献给了我呀。
afcn0
2007-12-26
这个cache什么东西,是不是就是对象数组还是个什么,没听说过
carrot
2007-12-26
good
carrot
your colleague
carrot
your colleague
sp42
2007-09-01
往事如烟了 呵呵
只是当年的激情。。不知现在算不算在延续着...
借javaeye这一宝地...抒心中之一幕...见谅了
只是当年的激情。。不知现在算不算在延续着...
借javaeye这一宝地...抒心中之一幕...见谅了
dengyin2000
2007-08-31
sp42 写道
Cache...这令我想起当年Cyrix 486DLC中那1kb的回写式缓存是多么的宝贵啊....
你那当年是什么年代。 我是没有经历过寸土寸斤的年代。 羡慕。
sp42
2007-08-30
Cache...这令我想起当年Cyrix 486DLC中那1kb的回写式缓存是多么的宝贵啊....
发表评论
提醒: 该博客已发表在公共论坛,博客所有留言会成为论坛回贴,留言请注意遵守论坛发贴规则
- 浏览: 220495 次
- 性别:

- 来自: 广州

- 详细资料
搜索本博客
我的相册
VB-seamless
共 13 张
共 13 张
最近加入圈子
最新评论
-
使用Terracotta和Tomcat建 ...
renavatior 写道"运行start.bat 9081 这样我们就启动了目 ...
-- by rainsf -
使用Terracotta和Tomcat建 ...
"运行start.bat 9081 这样我们就启动了目录9081中的tomcat ...
-- by renavatior -
广州3年多经验 5500的 ...
fucku 写道广州的软件厂家可比深圳多多了,不过比起北京上海来,还是少了很多, ...
-- by yongfan_420 -
广州3年多经验 5500的 ...
广州的软件厂家可比深圳多多了,不过比起北京上海来,还是少了很多,导致机会也没有这 ...
-- by fucku -
广州3年多经验 5500的 ...
想高工资就去厂家咯,老在集成商里面混能有多大个奔头
-- by fucku






评论排行榜