oscache
来源:互联网 发布:二分法查找c语言 编辑:程序博客网 时间:2024/04/29 16:24
所需要的jar包:
oscache-2.4.1.jar
假如要用oscache注解的话还需jar:
cglib-nodep-2.1_3.jar
commons-logging.jar
log4j-1.2.15.jar
spring-modules-cache.jar
spring.jar
oscache.properties配置如下:
# 是否使用内存作为缓存空间
cache.memory=true
cache.key=_oscache_cache
# 如果使用磁盘缓存(cache.memory=true),则需要指定磁盘存储接口实现
cache.persistence.class=com.opensymphony.oscache.plugins.diskpersistence.DiskPersistenceListener
# ie Windows:
cache.path=D:\\dcache
# 缓存调度算法
cache.algorithm=com.opensymphony.oscache.base.algorithm.LRUCache
#缓存管理事件监听器,通过这个监听器可以获知当前Cache的运行情况 cache.event.listeners=com.opensymphony.oscache.plugins.clustersupport.JMSBroadcastingListener
# 内存中缓存的最大容量
cache.capacity=1000
ibatis.xml
<?xml version="1.0"encoding="UTF-8"?>
<!DOCTYPEsqlMap
<sqlMap namespace="aaa">
type:
当type="OSCACHE",程序将自动在classpath下寻找oscache.properties
</sqlMap>
在web.xml进行一些简单的配置,oscache提供了强大的标签。主要是针对jsp的,如果项目中需把oscache.tld放到WEB-INF/classes下,在再web.xml中配置一下。
web.xml
在jsp中应用的话,还需简单的引入。<%@ tagliburi="oscache" prefix="cache" %>
以上是针对具体的页面的配置步骤。如果想针对某一页面的类型进行配置,可以利用过滤器来配置。比如我们想对以*.jsp的页面进行缓存的话,我们只需这样简单的配置在web.xml中。
<filter>
<filter-mapping>
</filter-mapping>
如果想对某一访问的路径action进行缓存的话,我们可以这样做,在一个jsp文件中简单的加上
jsp页面
<oscache:cache>
</oscache:cache>
OSCache的配置比较活的,你可以根据你的情况进行相应的配置。它主要是针对页面级的对象。
简单的说,缓存就是Map<key,value>,创建缓存就是添加一个map,使用就是通过key取value.
- OSCache
- OSCache
- OSCache
- OSCache
- OScache
- oscache
- OSCACHE
- oscache
- oscache
- OSCACHE
- oscache
- OSCACHE
- OSCache
- OSCache
- OSCACHE
- oscache
- OSCache使用指南
- OSCache入门教程
- simon手册翻译_part1
- 必须知道的.NET
- Func<T, TResult> 委托
- hibernate 数据库死锁
- 进入2000,标识一下
- oscache
- apt-proxy安装与配置服务器
- 在release下寻找程序崩溃原因
- asp.net将 DataTable 与 List 转成json输出
- poj1556 The Doors
- 女人,我想对你说,要了你之后.....
- Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools
- POM记录
- 数据库学习笔记