ehcache配置

ehcache配置

<?xml version="1.0" encoding="UTF-8"?>

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd">


<!-- 
diskStore:配置缓存数据落地到磁盘,该配置要结合cache标签中的overflowToDisk和diskPersistent属性共同使用,
当overflowToDisk和diskPersistent属性值均为true时缓存数据才会落地到磁盘。
path的默认值是"java.io.tmpdir"
-->
<!-- <diskStore path="D:/code_bak"/> -->
<!-- <diskStore path="java.io.tmpdir"/> -->

<!--
   缓存配置(可配置多个缓存):
maxElementsInMemory:【过时】,已经被maxEntriesLocalHeap属性代替。
maxEntriesLocalHeap:缓存中最多存放的对象的数量。
eternal:中文含义是"永恒的",值为true代表该缓存中的值永不过期。
timeToIdleSeconds:在一个元素过期之前,其最大的闲置时间(即最大的没有被访问的时间)。
timeToLiveSeconds:元素的存活时间(从创建到过期的时间间隔)。
memoryStoreEvictionPolicy:指定policy将会在maxEntriesLocalHeap值到达指定值时执行,清除缓存中长久不用的数据。
-->
<defaultCache maxEntriesLocalHeap="100" eternal="false"
timeToIdleSeconds="3600" timeToLiveSeconds="3600"
memoryStoreEvictionPolicy="LRU" overflowToDisk="false" diskPersistent="false" />
<cache name="sampleCache0" maxEntriesLocalHeap="100" eternal="false"
timeToIdleSeconds="3600" timeToLiveSeconds="3600"
memoryStoreEvictionPolicy="LRU" overflowToDisk="true" diskPersistent="true" />
<!--
<cache name="sampleCache1" maxEntriesLocalHeap="10000"
maxEntriesLocalDisk="1000" eternal="false" diskSpoolBufferSizeMB="20"
timeToIdleSeconds="300" timeToLiveSeconds="600"
memoryStoreEvictionPolicy="LFU" transactionalMode="off">
<persistence strategy="localTempSwap" />
</cache>
-->
<!--  
<cache name="sampleCache2" maxEntriesLocalHeap="1000" eternal="true"
memoryStoreEvictionPolicy="FIFO" />


<cache name="sampleCache3" maxEntriesLocalHeap="500" eternal="false"
overflowToDisk="true" diskPersistent="true" timeToIdleSeconds="300"
timeToLiveSeconds="600" diskExpiryThreadIntervalSeconds="1"
memoryStoreEvictionPolicy="LFU"></cache>


<cache name="sampleTerracottaCache" maxBytesLocalHeap="10m"
eternal="false" timeToIdleSeconds="3600" timeToLiveSeconds="1800">
<terracotta />
</cache>
-->
</ehcache>
<!-- 参考资料:
1. http://www.ehcache.org/ehcache.xml
2. http://www.ehcache.org/generated/2.10.0/html/ehc-all/#page/Ehcache_Documentation_Set%2Fre-ehcache_reference_documentation.html%23
-->
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值