ehcache.xml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="false"
  4. monitoring="autodetect" dynamicConfig="true">
  5. <diskStore path="java.io.tmpdir" />
  6. <defaultCache maxEntriesLocalHeap="10000" eternal="false"
  7. timeToIdleSeconds="120" timeToLiveSeconds="120" diskSpoolBufferSizeMB="30"
  8. maxEntriesLocalDisk="10000000" diskExpiryThreadIntervalSeconds="120"
  9. memoryStoreEvictionPolicy="LRU">
  10. <persistence strategy="localTempSwap" />
  11. </defaultCache>
  12. <!-- 配置自定义缓存 maxElementsInMemory:缓存中允许创建的最大对象数 eternal:缓存中对象是否为永久的,如果是,超时设置将被忽略,对象从不过期。
  13. timeToIdleSeconds:缓存数据的钝化时间,也就是在一个元素消亡之前, 两次访问时间的最大时间间隔值,这只能在元素不是永久驻留时有效,
  14. 如果该值是 0 就意味着元素可以停顿无穷长的时间。 timeToLiveSeconds:缓存数据的生存时间,也就是一个元素从构建到消亡的最大时间间隔值,
  15. 这只能在元素不是永久驻留时有效,如果该值是0就意味着元素可以停顿无穷长的时间。 overflowToDisk:内存不足时,是否启用磁盘缓存。 memoryStoreEvictionPolicy:缓存满了之后的淘汰算法。 -->
  16. <cache name="SimplePageCachingFilter" maxElementsInMemory="10000"
  17. eternal="false" overflowToDisk="false" timeToIdleSeconds="900"
  18. timeToLiveSeconds="1800" memoryStoreEvictionPolicy="LFU" />
  19. <cache name="user" maxElementsInMemory="100000" eternal="true"
  20. overflowToDisk="false" memoryStoreEvictionPolicy="FIFO" />
  21. <cache name="privilege" maxElementsInMemory="100000" eternal="true"
  22. overflowToDisk="false" memoryStoreEvictionPolicy="FIFO" />
  23. <!-- <cache name="cfg" -->
  24. <!-- maxElementsInMemory="10000" -->
  25. <!-- eternal="true" -->
  26. <!-- overflowToDisk="false" -->
  27. <!-- memoryStoreEvictionPolicy="FIFO" /> -->
  28. <!-- <cache name="security_code" -->
  29. <!-- maxElementsInMemory="10000" -->
  30. <!-- eternal="true" -->
  31. <!-- overflowToDisk="false" -->
  32. <!-- memoryStoreEvictionPolicy="FIFO" /> -->
  33. <!-- <cache name="security_code_num" -->
  34. <!-- maxElementsInMemory="10000" -->
  35. <!-- eternal="true" -->
  36. <!-- overflowToDisk="false" -->
  37. <!-- memoryStoreEvictionPolicy="FIFO" /> -->
  38. </ehcache>