ehcache.xml 1.6 KB

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