本站首页    管理页面    写新日志    退出

«September 2025»
123456
78910111213
14151617181920
21222324252627
282930


公告

  如果你忍了,欺负你的人将来可能就进监狱了。如果你反击,欺负你的人将来可能就获选十大杰出青年了。

        QQ: 3159671

http://greenboy.javaeye.com/

http://blog.sina.com.cn/u/1278341164 小鸟吹烟


我的分类(专题)

日志更新

最新评论

留言板

链接

Blog信息
blog名称:小鸟吹烟
日志总数:157
评论数量:424
留言数量:-1
访问次数:1257646
建立时间:2006年10月23日




[SSH 学习区]oscache 与 ehcache的比较
心得体会,  软件技术

tone 发表于 2007/1/31 11:55:46

一.ehcache主要是对数据库访问的缓存,相同的查询语句只需查询一次数据库,   从而提高了查询的速度,使用spring的AOP可以很容易实现这一功能.   http://ehcache.sourceforge.net/   ehcache.xml      <cache name="sampleCache1"        maxElementsInMemory="10000"        eternal="false"        timeToIdleSeconds="300"        timeToLiveSeconds="600"        overflowToDisk="true"        /> org.springframework.cache.ehcache.EhCacheManagerFactoryBean org.springframework.cache.ehcache.EhCacheFactoryBean org.springframework.aop.support.RegexpMethodPointcutAdvisor 二.  oscache 主要是对页面的缓存,可以整页或者指定网页某一部分缓存,同时   指定他的过期时间,这样在此时间段里面访问的数据都是一样的 1.log4j-1.2.8.jar,oscache-2.3.2.jar,commons-logging.jar,jgroups-all.jar 2.拷贝cach\etc\下的oscache.tld,oscache.properties 到WEB-INF\classes 3.web.xml  <taglib><taglib-uri>oscache</taglib-uri><taglib-location>/WEB-INF/classes/ oscache.tld</taglib-location></taglib>    <filter>       <filter-name>CacheFilter</filter-name>   <filter-class>com.opensymphony.oscache.web.filter.CacheFilter</filter-class>      <init-param>                   <param-name>time</param-name>            <param-value>60</param-value>        </init-param>         <init-param>                                      <param-name>scope</param-name>          <param-value>session</param-value>       </init-param>   </filter><filter-mapping>       <filter-name>CacheFilter</filter-name>         <url-pattern>/*.jsp</url-pattern></filter-mapping>     http://www.opensymphony.com/oscache/download.html下载Oscache的最新版本  可以使用内存、硬盘空间、同时使用内存和硬盘或者提供自己的其他资源(需要自己提供适配器)作为缓存区。 使用内存作为缓存区将可以提供更好的性能 使用硬盘作为缓存区可以在服务器重起后迅速恢复缓存内容 同时使用内存和硬盘作为缓存区则可以减少对内存的占用  


阅读全文(4535) | 回复(0) | 编辑 | 精华
 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.047 second(s), page refreshed 144788755 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号