1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?xml version="1.0" encoding="UTF-8"?>
- <ehcache name="ColorCache">
- <!--
- 缓存在磁盘上的存储位置
- -->
- <diskStore path = "java.io.tmpdir" />
-
- <!--
- 缓存配置。
- 以下属性是必须的:
- name - cache的标识符,在一个CacheManager中必须唯一
- maxElementsInMemory - 在内存中缓存的element的最大数目
- maxElementsOnDisk - 在磁盘上缓存的element的最大数目
- eternal - 设定缓存的elements是否有有效期。如果为true,timeouts属性被忽略
- overflowToDisk - 设定当内存缓存溢出的时候是否将过期的element缓存到磁盘上
- 以下属性是可选的:
- timeToIdleSeconds - 缓存element在过期前的空闲时间。默认为0,表示可空闲无限时间.
- timeToLiveSeconds - 缓存element的有效生命期。这个类似于timeouts,默认为0,不过期
- diskPersistent - 在VM重启的时候是否持久化磁盘缓存,默认是false。
- diskExpiryThreadIntervalSeconds - 磁盘缓存的清理线程运行间隔,默认是120秒.
- memoryStoreEvictionPolicy - 当内存缓存达到最大,有新的element加入的时候,移除缓存中element的策略。默认是LRU,可选的有LFU和FIFO
- -->
- <defaultCache
- maxElementsInMemory="1000000"
- eternal="true"
- overflowToDisk="false"
- diskSpoolBufferSizeMB="30"
- maxElementsOnDisk="10000000"
- clearOnFlush="true"
- diskExpiryThreadIntervalSeconds="120">
- </defaultCache>
-
- <cache
- name="Order"
- maxElementsInMemory="80000000"
- eternal="false"
- timeToIdleSeconds="120"
- timeToLiveSeconds="120"
- overflowToDisk="true"
- clearOnFlush="true"
- maxElementsOnDisk="100000000"
- diskExpiryThreadIntervalSeconds="120"
- />
-
- </ehcache>
|