12345678910111213141516171819202122232425262728293031 |
- <?xml version="1.0" encoding="UTF-8"?>
- <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="../config/ehcache.xsd">
- <!-- 路径 -->
- <diskStore path="C:\mybatis\ehcache" />
- <!--
- defaultCache:默认的缓存配置信息,如果不加特殊说明,则所有对象按照此配置项处理
- maxElementsInMemory:设置了缓存的上限,最多存储多少个记录对象
- maxElementsOnDisk:在磁盘上缓存的element的最大数目,默认值为0,表示不限制。
- eternal:代表对象是否永不过期
- overflowToDisk: 如果内存中数据超过内存限制,是否要缓存到磁盘上。
- timeToIdleSeconds:最大的发呆时间
- timeToLiveSeconds:最大的存活时间
- diskExpiryThreadIntervalSeconds: 对象检测线程运行时间间隔。标识对象状态的线程多 长时间运行一次。
- memoryStoreEvictionPolicy: 如果内存中数据超过内存限制,向磁盘缓存时的策略。默认值 LRU,可选FIFO、LFU。
- FIFO ,first in first out (先进先出).
- LFU , Less Frequently Used (最少使用).
- LRU ,Least Recently Used(最近最少使用)
- -->
- <defaultCache
- maxElementsInMemory="1"
- maxElementsOnDisk="0"
- eternal="false"
- overflowToDisk="true"
- timeToIdleSeconds="1"
- timeToLiveSeconds="1"
- diskExpiryThreadIntervalSeconds="1"
- memoryStoreEvictionPolicy="LRU">
- </defaultCache>
- </ehcache>
|