ehcache.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd">
  4. <diskStore path="java.io.tmpdir" />
  5. <!-- Mandatory Default Cache configuration. These settings will be applied
  6. to caches created programmtically using CacheManager.add(String cacheName) -->
  7. <!-- name:缓存名称。 maxElementsInMemory:缓存最大个数。 eternal:对象是否永久有效,一但设置了,timeout将不起作用。
  8. timeToIdleSeconds:设置对象在失效前的允许闲置时间(单位:秒)。仅当eternal=false对象不是永久有效时使用,可选属性,默认值是0,也就是可闲置时间无穷大。
  9. timeToLiveSeconds:设置对象在失效前允许存活时间(单位:秒)。最大时间介于创建时间和失效时间之间。仅当eternal=false对象不是永久有效时使用,默认是0.,也就是对象存活时间无穷大。
  10. overflowToDisk:当内存中对象数量达到maxElementsInMemory时,Ehcache将会对象写到磁盘中。 diskSpoolBufferSizeMB:这个参数设置DiskStore(磁盘缓存)的缓存区大小。默认是30MB。每个Cache都应该有自己的一个缓冲区。
  11. maxElementsOnDisk:硬盘最大缓存个数。 diskPersistent:是否缓存虚拟机重启期数据 Whether the disk
  12. store persists between restarts of the Virtual Machine. The default value
  13. is false. diskExpiryThreadIntervalSeconds:磁盘失效线程运行时间间隔,默认是120秒。 memoryStoreEvictionPolicy:当达到maxElementsInMemory限制时,Ehcache将会根据指定的策略去清理内存。默认策略是LRU(最近最少使用)。你可以设置为FIFO(先进先出)或是LFU(较少使用)。
  14. clearOnFlush:内存数量最大时是否清除。 -->
  15. <defaultCache maxElementsInMemory="10000" eternal="false"
  16. timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true"
  17. maxElementsOnDisk="10000000" diskPersistent="true"
  18. diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU" />
  19. <!-- 1111-->
  20. <cache name="TEST" maxEntriesLocalHeap="2000"
  21. eternal="false" timeToIdleSeconds="3600" timeToLiveSeconds="0"
  22. overflowToDisk="false" statistics="true">
  23. </cache>
  24. <cache name="cms-category-cache" maxEntriesLocalHeap="2000" eternal="false"
  25. timeToIdleSeconds="3600" timeToLiveSeconds="0" overflowToDisk="true"
  26. statistics="true">
  27. </cache>
  28. <cache name="cms-content-cache" maxEntriesLocalHeap="2000" eternal="false"
  29. timeToIdleSeconds="3600" timeToLiveSeconds="0" overflowToDisk="true"
  30. statistics="true">
  31. </cache>
  32. <cache name="cms_modelFiled-cache" maxEntriesLocalHeap="2000"
  33. eternal="false" timeToIdleSeconds="3600" timeToLiveSeconds="0"
  34. overflowToDisk="false" statistics="true">
  35. </cache>
  36. <cache name="cms-model-cache" maxEntriesLocalHeap="2000"
  37. eternal="false" timeToIdleSeconds="3600" timeToLiveSeconds="0"
  38. overflowToDisk="false" statistics="true">
  39. </cache>
  40. <cache name="cms-topic-cache" maxEntriesLocalHeap="2000"
  41. eternal="false" timeToIdleSeconds="3600" timeToLiveSeconds="0"
  42. overflowToDisk="false" statistics="true">
  43. </cache>
  44. <cache name="cms-site-cache"
  45. maxEntriesLocalHeap="2000"
  46. eternal="false" timeToIdleSeconds="3600" timeToLiveSeconds="0"
  47. overflowToDisk="false" statistics="true">
  48. </cache>
  49. <cache name="cms-ad-cache"
  50. maxEntriesLocalHeap="2000"
  51. eternal="false"
  52. timeToIdleSeconds="3600"
  53. timeToLiveSeconds="0"
  54. overflowToDisk="false"
  55. statistics="true">
  56. </cache>
  57. <cache name="shiro-kickout-cache"
  58. maxEntriesLocalHeap="2000"
  59. eternal="false"
  60. timeToIdleSeconds="3600"
  61. timeToLiveSeconds="0"
  62. overflowToDisk="false"
  63. statistics="true">
  64. </cache>
  65. <cache name="cms-login-cache"
  66. maxEntriesLocalHeap="2000"
  67. eternal="false"
  68. timeToIdleSeconds="300"
  69. timeToLiveSeconds="0"
  70. overflowToDisk="false"
  71. statistics="true">
  72. </cache>
  73. </ehcache>