本人想让系统中的所有缓存都5分钟失效。在配置文件中设置如下:
<?xml version="1.0" encoding="GB2312"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd">
<diskStore path="java.io.tmpdir"/>
<defaultCache
maxElementsInMemory="500"
eternal="false"
timeToIdleSeconds="300"
timeToLiveSeconds="300"
overflowToDisk="true" />
</ehcache>
上面这种配置,5分钟之后,缓存仍然有效,如果我用下面这样的配置,缓存 5分钟之后就失效了。
<?xml version="1.0" encoding="GB2312"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd">
<diskStore path="java.io.tmpdir"/>
<defaultCache
maxElementsInMemory="500"
eternal="false"
timeToIdleSeconds="300"
timeToLiveSeconds="300"
overflowToDisk="true" />
<cache name="HomeGuideCache"
maxElementsInMemory="10000"
eternal="false"
overflowToDisk="false"
timeToIdleSeconds="300"
timeToLiveSeconds="300"
memoryStoreEvictionPolicy="LFU" />
<cache name="IHealthTypecache"
maxElementsInMemory="10000"
eternal="false"
overflowToDisk="false"
timeToIdleSeconds="300"
timeToLiveSeconds="300"
memoryStoreEvictionPolicy="LFU" />
</ehcache>
问题1:如果我要系统都使用默认缓存,且5分钟失效,应该怎么配置?
把