Add cache.xml, config ehcache

0.6
LSZ 2016-07-17 22:58:59 +08:00
parent 15a5ba1d54
commit b9d135e896
2 changed files with 70 additions and 3 deletions

View File

@ -12,12 +12,61 @@
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
timeToIdleSeconds="240"
timeToLiveSeconds="240"
overflowToDisk="true"
maxElementsOnDisk="10000000"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
diskExpiryThreadIntervalSeconds="240"
memoryStoreEvictionPolicy="LRU"/>
<cache name="clientDetailsCache"
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="240"
timeToLiveSeconds="240"
overflowToDisk="true"
maxElementsOnDisk="10000000"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="240"
memoryStoreEvictionPolicy="LRU"/>
<cache name="accessTokenCache"
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="240"
timeToLiveSeconds="240"
overflowToDisk="true"
maxElementsOnDisk="10000000"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="240"
memoryStoreEvictionPolicy="LRU"/>
<cache name="authorizationCodeCache"
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="240"
timeToLiveSeconds="240"
overflowToDisk="true"
maxElementsOnDisk="10000000"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="240"
memoryStoreEvictionPolicy="LRU"/>
<cache name="userCache"
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="240"
timeToLiveSeconds="240"
overflowToDisk="true"
maxElementsOnDisk="10000000"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="240"
memoryStoreEvictionPolicy="LRU"/>
</ehcache>

View File

@ -0,0 +1,18 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cache="http://www.springframework.org/schema/cache"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/cache
http://www.springframework.org/schema/cache/spring-cache.xsd">
<cache:annotation-driven/>
<!-- cache manager -->
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager" p:cacheManager-ref="ehcache"/>
<bean class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" id="ehcache"
p:configLocation="classpath:ehcache.xml" p:shared="true"/>
</beans>