|
|
缓存策略集成 |
|
(1)与OSCache集成
OSCache项目地址:http://www.opensymphony.com/oscache
配置commontemplate.properties:
templateCache=org.commontemplate.standard.cache.OSCache()
配置oscache.properties:
cache.algorithm=com.opensymphony.oscache.base.algorithm.LRUCache
cache.capacity=1000
(2)与EHCache集成
EHCache项目地址:http://ehcache.sourceforge.net
配置commontemplate.properties:
templateCache=org.commontemplate.standard.cache.EHCache()
配置ehcache.xml:
<ehcache>
<diskStore path="java.io.tmpdir" />
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
/>
</ehcache>
(3)与JCache(jsr107)集成
JCache(jsr107)项目地址:http://www.jcp.org/en/jsr/detail?id=107
配置commontemplate.properties:
templateCache=org.commontemplate.standard.cache.JCache()
templateCache.cacheName=ehcache
|
|
|