kinght2008 发表于 2017-1-5 09:18:41

apache jcs cache system 使用配置简介

  一 词汇理解
  Elements:目前的理解是要被放进 Caching System 的对象
  Regions:你可以将 Caching System艺命名空间区域划分提供基本的 namespace 功能。这样有什么样的好处呢?每一区的需要更新的频率不太一样,可以分开设定。
  Auxiliaries:Auxiliaries 是可以让 Regions 使用的 plug-in,基于磁盘序列化的存储,缓存的持久化到硬盘。
  二、配置文件解析
  配置文件名为 cache.ccf
  ?/P>
  # DEFAULT CACHE REGION  
  # 这是预设的 region
  # 这里是设定使用什么 Auxiliaries 可以不填,使用默认值
  jcs.default=
  # 设定使用的 cache 属性管理类别
  jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  # 设定 cache 内对象的上限
  jcs.default.cacheattributes.MaxObjects=1000
  # 设定 memory cache 的算法
  #jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  # 设定是否使用 memory shrinker 冗余内存清除程序
  jcs.default.cacheattributes.UseMemoryShrinker=true
  # 当有使用 memory shrinker 时,设定闲置内存的过期时间(就是超过这个时长时,根据缓存算法,超出MaxObjects(内对象的上限)的那部分对象将要被清除或者被存入磁盘中)
  jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600
  # 设定 shinker 执行时间间隔
  jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
  # 设定 element 属性类别
  jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes
  # 设定让 element 会「过期」  单词Eternal(永久的意思)
  jcs.default.elementattributes.IsEternal=false
  # 设定 element 建立后能存活多久,IsEternal=false时有效
  jcs.default.elementattributes.MaxLifeSeconds=21600
  # 设定 element 可闲置的时间,IsEternal=false时有效
  jcs.default.elementattributes.IdleTime=1800
  如果你想设定不同的 region
  ?/P>
  # 以此类推
  jcs.myregion=
  jcs.myregion.cacheattributes=
  org.apache.jcs.engine.CompositeCacheAttributes
  .....
页: [1]
查看完整版本: apache jcs cache system 使用配置简介