中国IT实验室LOGO 首页 | 互联网 | IT动态 | IT培训 | Cisco | Windows | Linux | Java | .Net | Oracle | 软件测试 | C/C++ | 嵌入式 | 存储世界服务器 | 华为 | 网络设备 | IDC | 安全 | 求职招聘 | 数字网校 | 北大青鸟 | 技术专题 | 电子书下载 | 教学视频 | 源码下载 | 搜索 | 博客 | 活动沙龙 | 论坛
中国IT实验室Linux频道
首页 资讯动态 认证考试 新手入门 核心技术 高级技术 J2EE J2ME Java&XML 开源技术 其他技术 RSS订阅 论坛 专题
您现在的位置: 中国IT实验室 >> Java >> 新手入门 >> 安装配置 >> 正文

osCache 配置说明

    osCache 配置说明

 

    作者: onebodysoftware@hotmail.com (MSN)

 

    E文地址:http://wiki.opensymphony.com/display/CACHE/Configuration

 

    这个东西今天小试了一下,总体感觉还不错.就不知道比起JBoss cache 有没什么差别(现在本人还不得而知啊)

 

    主要是针对 osCache 的配置文件做了简单的翻译; 如有错误敬请修正.修改的文档请共享一下,谢谢!

 

    oscache.properties  osCache的配置文件   放在 webapp/WEB-INF/classes/下;

 

    oscache.properties 中的配置项如下:

 

    1、cache.memory:

       原文:

          Valid values are true or false, with true being the default value. If you want to disable memory caching,

          just comment out or remove this line.

 

          Note: disabling memory AND disk caching is possible but fairly stupid

 

       译文:

          是否使用内存缓存; true 或 false。默认为true;

 

          个人推荐内存方法,在速度会有些优势;

 

    2、cache.capacity

       原文:

           The maximum number of items that a cache will hold. By default the capacity is unlimited - the cache will never remove any items.

           Negative values will also be treated as meaning unlimited capacity.

 

       译文:

          缓存的最大数量。默认是不限制,cache不会移走任何缓存内容。负数被视不限制。

 

    3、cache.algorithm

       原文:

           The default cache algorithm to use. Note that in order to use an algorithm the cache size must also be specified.

           If the cache size is not specified, the cache algorithm will be Unlimited cache regardless of the value of this property. If you specify a size but not an algorithm, the cache algorithm used will be com.opensymphony.oscache.base.algorithm.LRUCache.

 

           OSCache currently comes with three algorithms:

 

                 * com.opensymphony.oscache.base.algorithm.LRUCache - Least Recently Used.

                  This is the default when a cache.capacity is set.

                 * com.opensymphony.oscache.base.algorithm.FIFOCache - First In First Out.

                 * com.opensymphony.oscache.base.algorithm.UnlimitedCache - Content that is added to the cache will never be discarded.

                  This is the default when no value is set for the cache.capacity property.

 

       译文:

           运算规则。为了使用规则,cache的size必须是指定的。

           如果cache的size不指定的话, 将不会限制缓存对象的大小。如果指定了cache的size,但不指定algorithm,

           那它会默认使用:com.opensymphony.oscache.base.algorithm.LRUCache

 

           有下面三种规则:

               * com.opensymphony.oscache.base.algorithm.LRUCache       : last in first out(最后插入的最先调用)。默认选项。

               * com.opensymphony.oscache.base.algorithm.FIFOCache      : first int first out(最先插入的最先调用)。

               * com.opensymphony.oscache.base.algorithm.UnlimitedCache : cache中的内容将永远不会被丢弃。

               如果cache.capacity不指定值的话,它将被设为默认选项。

 

 

[1] [2] [3] [4] 下一页

【责编:landy】

相关产品和培训
文章评论
 友情推荐链接
 认证培训
 专题推荐

 ·Java EE 6规范中文版
 ·Oracle 10g OCP考证秘笈
 ·算法分析与设计之五大常用算法
 ·开发必备 漫谈Java加密保护
 ·嵌入式开发--ARM技术专题
 ·C/C++指针,认真了解,灵活运用
 ·.NET开发:C#实用基础教程
 ·软件测试工具QTP学习专题
 ·嵌入式开发单片机解决方案专题
 ·Java开发环境 Greenfoot 程序员手册
 今日更新
 社区讨论
 博客论点
 频道精选
 Java 频道导航