在JScript中使用缓存技术的实际代码(2)
Description: operate system cache
@Copyright: Copyright (c) 2007
@Author: xujiwei
@Website: http://www.xujiwei.cn/
@Version: 1.0
@Time: 2007-06-29 12:03:45
**/
var xbsCache = {
get: function(key) {
return Application.StaticObjects("xbsCache").Item("Cache."+key);
},
put: function(key, data) {
Application.Lock();
Application.StaticObjects("xbsCache").Item("Cache."+key)=data;
Application.UnLock();
},
remove: function(key) {
Application.Lock();
Application.StaticObjects("xbsCache").Remove("Cache."+key);
Application.UnLock();
},
clear: function() {
Application.Lock();
Application.StaticObjects("xbsCache").RemoveAll();
Application.UnLock();
}
}
</script>