| 123456789101112131415161718192021222324252627282930 | <?xml version="1.0" encoding="gbk"?><ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd">    <diskStore path="java.io.tmpdir"/>     <defaultCache maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="30" timeToLiveSeconds="30" overflowToDisk="false"/>    <!--         配置自定义缓存        maxElementsInMemory:缓存中允许创建的最大对象数        eternal:缓存中对象是否为永久的,如果是,超时设置将被忽略,对象从不过期。        timeToIdleSeconds:缓存数据的钝化时间,也就是在一个元素消亡之前,                    两次访问时间的最大时间间隔值,这只能在元素不是永久驻留时有效,                    如果该值是 0 就意味着元素可以停顿无穷长的时间。        timeToLiveSeconds:缓存数据的生存时间,也就是一个元素从构建到消亡的最大时间间隔值,                    这只能在元素不是永久驻留时有效,如果该值是0就意味着元素可以停顿无穷长的时间。        overflowToDisk:内存不足时,是否启用磁盘缓存。        memoryStoreEvictionPolicy:缓存满了之后的淘汰算法。                timeToLiveSeconds和timeToIdleSeconds,分别简称为ttl和tti。         在通常的解释中,前者表示一条缓存自创建时间起多少秒后失效,而后者表示一条缓存自最后读取或更新起多少秒失效    --> <cache name="defCache"        maxElementsInMemory="10000"        eternal="false"        overflowToDisk="true"        timeToIdleSeconds="0"        timeToLiveSeconds="0"        memoryStoreEvictionPolicy="LFU" /></ehcache>
 |