Chinaunix首页 | 论坛 | 博客
  • 博客访问: 542685
  • 博文数量: 855
  • 博客积分: 40000
  • 博客等级: 大将
  • 技术积分: 5005
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-16 19:08
文章分类

全部博文(855)

文章存档

2011年(1)

2008年(854)

我的朋友

分类:

2008-10-16 19:17:00

    osCache 配置说明

 

    作者: (MSN)

 

    E文地址:

 

    这个东西今天小试了一下,总体感觉还不错.就不知道比起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]    

【责编:landy】

--------------------next---------------------

阅读(197) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~