kdayun-template/modules/kdayun-app/src/main/resources/ehcache-shiro.xml

39 lines
2.1 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?xml version="1.0" encoding="UTF-8"?>
<ehcache updateCheck="true" name="MyEhcache-Shiro">
<!--
EHCache 配置文件解释:
name Cache的名称必须是唯一的(ehcache会把这个cache放到HashMap里)
maxElementsInMemory 内存中保持的对象数量
maxElementsOnDisk DiskStore中保持的对象数量默认值为0表示不限制
eternal 是否是永恒数据,如果是,则它的超时设置会被忽略
overflowToDisk 如果内存中数据数量超过maxElementsInMemory限制是否要缓存到磁盘上
timeToIdleSeconds 对象空闲时间指对象在多长时间没有被访问就会失效。只对eternal为false的有效。默认值0表示一直可以访问
timeToLiveSeconds 对象存活时间指对象从创建到失效所需要的时间。只对eternal为false的有效。默认值0表示一直可以访问
diskPersistent 是否在磁盘上持久化。指重启jvm后数据是否有效。默认为false
diskExpiryThreadIntervalSeconds 对象检测线程运行时间间隔。标识对象状态的线程多长时间运行一次
diskSpoolBufferSizeMB DiskStore使用的磁盘大小默认值30MB。每个cache使用各自的DiskStore
memoryStoreEvictionPolicy 如果内存中数据超过内存限制向磁盘缓存时的策略。默认值LRU可选FIFO、LFU
-->
<!-- 默认的缓存设置,如果没有设置缓存的名称就使用这个策略 -->
<defaultCache
maxElementsInMemory="10000"
maxElementsOnDisk="0"
eternal="false"
overflowToDisk="true"
diskPersistent="false"
timeToIdleSeconds="20"
timeToLiveSeconds="0"
diskSpoolBufferSizeMB="50"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LFU"
/>
<cache name="tokenCache"
maxEntriesLocalHeap="2000"
maxElementsInMemory="50000"
eternal="true"
overflowToDisk="true"
statistics="true"
diskPersistent="true"
memoryStoreEvictionPolicy="LFU">
</cache>
</ehcache>