ITeye博客

OSCache

共 6 篇文章

oscache.properties

Configuration:配置oscache.properties 1、cache.memory: true 或者 false。默认为true 不使用内存缓存而使用硬盘缓存是很愚蠢的事情。 2、cache.capacity 缓存object的最大数量值。默认是不限制,cache不会移走任何缓存内容。负数被当作不限制。 3、cache.algorithm 运算规则。为了使用规则,cache的size必须是指定的。 如果cache的size不指定的话,法则将不会限制缓存对象的大小。 如果你指定了cache的size,但不指定algorithm,那它会默认使用:com.opensymphony.…

2011-08-31 10:14 · OSCache

Cache使用的情况

适合使用Cache的情况: 1、被处理的内容短时间不变,所以短时间内可以作为静态内容进行处理 2、在一个不太长的时间内,被处理的内容可能或者必定产生变化,所以必须将他们作为动态内容进行处理 3、在合理的时间区段内可以忽略被处理内容变化后带来的影响 4、对这些内容的处理动作比较消耗系统性能,影响系统响应时间 缓存处理: 1、缓存信息 当上述的基础数据或者统计报表第一次被访问时,被处理的内容被当作动态信息,基础数库从数据库中获得,统计报表也会被生成符合要求的图形、文件,然后这些信息都会被放入缓存信息中。 2、响应信息由缓存提供 当上述的基础数据或者统计报表继续被访问时,系统将会首先检查缓存信息中…

2011-08-31 10:08 · OSCache

freemarker中使用OSCache

第一要在web.xml中加入以下配置 oscache /WEB-INF/classes/oscache.tld 第二在/web-inf/lib下加入os的jar包 第三在/web-inf/classes下加入oscache的配置文件和tld 第四在freemarker中按如下方法使用 <#assign cache=JspTaglibs["/WEB-INF/classes/oscache.tld"] /> <@cache.cache key="xxx" time=20> ${fowUrlaa}

2011-08-30 16:58 · OSCache

OSCache filter

缓存过滤器 CacheFilter CacheFilter com.opensymphony.oscache.web.filter.CacheFilter time 60 scope session CacheFilter *.jsp

2011-08-30 15:45 · OSCache

OSCache packages

http://www.opensymphony.com/oscache/api/ com.opensymphony.oscache.base Classes AbstractCacheAdministrator Cache CacheEntry Config EntryUpdateState com.opensymphony.oscache.base.algorithm Classes AbstractConcurrentReadCache AbstractConcurrentReadCache.Entry FIFOCache LRUCache UnlimitedCache com.open…

2011-08-30 15:21 · OSCache

OSCache 实例

// package com.wdf.cache; import java.util.Date; import com.opensymphony.oscache.base.NeedsRefreshException; import com.opensymphony.oscache.general.GeneralCacheAdministrator; public class BaseCache extends GeneralCacheAdministrator { //过期时间(单位为秒); protected int refreshPeriod; //关键字前缀字符; protected …

2011-08-30 15:07 · OSCache