Alatus Lee 3419cc6e7f 提交
2025-10-05 17:41:23 +08:00

27 lines
2.0 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd" updateCheck="false">
<diskStore path="java.io.tmpdir" /> <!-- 缓存存放目录(此目录为放入系统默认缓存目录),也可以是”D:/cache“ java.io.tmpdir -->
<!-- 默认缓存配置. -->
<defaultCache maxEntriesLocalHeap="100" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600"
overflowToDisk="true" maxEntriesLocalDisk="100000" />
<!--
nameCache的唯一标识
maxElementsInMemory内存中最大缓存对象数
maxElementsOnDisk磁盘中最大缓存对象数若是0表示无穷大
eternalElement是否永久有效一但设置了timeout将不起作用
overflowToDisk配置此属性当内存中Element数量达到maxElementsInMemory时Ehcache将会Element写到磁盘中
timeToIdleSeconds设置Element在失效前的允许闲置时间。仅当element不是永久有效时使用可选属性默认值是0也就是可闲置时间无穷大
timeToLiveSeconds设置Element在失效前允许存活时间。最大时间介于创建时间和失效时间之间。仅当element不是永久有效时使用默认是0.也就是element存活时间无穷大
diskPersistent是否缓存虚拟机重启期数据
diskExpiryThreadIntervalSeconds磁盘失效线程运行时间间隔默认是120秒
diskSpoolBufferSizeMB这个参数设置DiskStore磁盘缓存的缓存区大小。默认是30MB。每个Cache都应该有自己的一个缓冲区
memoryStoreEvictionPolicy当达到maxElementsInMemory限制时Ehcache将会根据指定的策略去清理内存。默认策略是LRU最近最少使用。你可以设置为FIFO先进先出或是LFU较少使用
-->
<cache name="varCache" timeToIdleSeconds="1200" timeToLiveSeconds="600" maxEntriesLocalHeap="600" eternal="true" overflowToDisk="true"/>
</ehcache>