Jelajahi Sumber

修改ehcache配置文件

shuzheng 9 tahun lalu
induk
melakukan
4faea5d5ba

+ 1 - 1
common/src/main/resources/applicationContext-ehcache.xml

@@ -13,7 +13,7 @@
 
 	<!-- cache管理器配置 -->
 	<bean id="cacheManagerFactory" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
-		<property name="configLocation"  value="classpath:ehcache-common.xml"/>
+		<property name="configLocation"  value="classpath:ehcache.xml"/>
 	</bean>
 
 	<!-- 默认是cacheManager -->

+ 11 - 1
common/src/main/resources/ehcache-common.xml → common/src/main/resources/ehcache.xml

@@ -2,8 +2,18 @@
 <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd">
     <diskStore path="java.io.tmpdir"/>
+    <defaultCache
+            maxElementsInMemory="10000"
+            eternal="false"
+            timeToIdleSeconds="120"
+            timeToLiveSeconds="120"
+            maxElementsOnDisk="10000000"
+            diskExpiryThreadIntervalSeconds="120"
+            memoryStoreEvictionPolicy="LRU">
+        <persistence strategy="localTempSwap"/>
+    </defaultCache>
     <cache
-            name="ehcache_common"
+            name="ehcache"
             eternal="false"
             timeToIdleSeconds="120"
             timeToLiveSeconds="300"