加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ehcache.xml

发布时间:2020-12-16 00:30:25 所属栏目:百科 来源:网络整理
导读:? xml version = "1.0" encoding = "UTF-8" ? !-- defaultCache节点为缺省的缓存策略 maxElementsInMemory内存中最大允许存在的对象数量 eternal设置缓存中的对象是否永远不过期 overflowToDisk把溢出的对象存放到硬盘上 timeToIdleSeconds指定缓存对象空闲
  1. <?xmlversion="1.0"encoding="UTF-8"?>
  2. <!--
  3. defaultCache节点为缺省的缓存策略
  4. maxElementsInMemory内存中最大允许存在的对象数量
  5. eternal设置缓存中的对象是否永远不过期
  6. overflowToDisk把溢出的对象存放到硬盘上
  7. timeToIdleSeconds指定缓存对象空闲多长时间就过期,过期的对象会被清除掉
  8. timeToLiveSeconds指定缓存对象总的存活时间
  9. diskPersistent当jvm结束是是否持久化对象
  10. diskExpiryThreadIntervalSeconds指定专门用于清除过期对象的监听线程的轮询时间
  11. -->
  12. <ehcache>
  13. diskStorepath="D:cache"/>
  14. <!--默认-->
  15. defaultCachemaxElementsInMemory="1000"eternal="false"overflowToDisk="true"
  16. timeToIdleSeconds="120"
  17. timeToLiveSeconds="180"
  18. diskPersistent="false"
  19. diskExpiryThreadIntervalSeconds="60" <!--如果在bean中设置了cacheusage="read-only"region=""/>
  20. 可以通过region里面的值来设置特定的cache--cachename="hwt.pojo.Articles"maxElementsInMemory="100"eternal="false"
  21. overflowToDisk="true"timeToIdleSeconds="300"timeToLiveSeconds="600"diskPersistent="false"</>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读