SSI开发:ehcache.xml标准配置模板

<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="true"
monitoring="autodetect">

<defaultCache maxElementsInMemory="10000" eternal="false" timetoIdleSeconds="120" timetoLiveSeconds="120" overflowTodisk="true" maxElementsOndisk="10000000" diskPersistent="false" diskExpiryThreadIntervalSeconds="120" memoryStoreevictionPolicy="LRU" /> <!-- 1.必须要有的属性: name: cache的名字,用来识别不同的cache,必须惟一。 maxElementsInMemory: 内存管理的缓存元素数量最大限值。 maxElementsOndisk: 硬盘管理的缓存元素数量最大限值。认值为0,就是没有限制。 eternal: 设定元素是否持久话。若设为true,则缓存元素不会过期。 overflowTodisk: 设定是否在内存填满的时候把数据转到磁盘上。 2.下面是一些可选属性: timetoIdleSeconds: 设定元素在过期前空闲状态的时间,只对非持久性缓存对象有效。认值为0,值为0意味着元素可以闲置至无限长时间。 timetoLiveSeconds: 设定元素从创建到过期的时间。其他与timetoIdleSeconds类似。 diskPersistent: 设定在虚拟机重启时是否进行磁盘存储,认为false.(我的直觉,对于安全小型应用,宜设为true)。 diskExpiryThreadIntervalSeconds: 访问磁盘线程活动时间。 diskSpoolBufferSizeMB: 存入磁盘时的缓冲区大小,认30MB,每个缓存都有自己的缓冲区。 memoryStoreevictionPolicy: 元素逐出缓存规则。共有三种,Recently Used (LRU)最近最少使用,为认。 First In First Out (FIFO),先进先出。Less Frequently Used(specified as LFU)最少使用 --> <cache name="testCache" maxElementsInMemory="10000" maxElementsOndisk="1000" eternal="false" overflowTodisk="true" diskSpoolBufferSizeMB="20" timetoIdleSeconds="300" timetoLiveSeconds="600" memoryStoreevictionPolicy="LFU" /> <cache name="dictionaryCache" maxElementsInMemory="10000" maxElementsOndisk="1000" eternal="true" overflowTodisk="true" diskSpoolBufferSizeMB="20" timetoIdleSeconds="300" timetoLiveSeconds="600" memoryStoreevictionPolicy="LFU" /> <cache name="autoCompleteCache" maxElementsInMemory="10000" maxElementsOndisk="1000" eternal="false" overflowTodisk="true" diskSpoolBufferSizeMB="20" timetoIdleSeconds="300" timetoLiveSeconds="600" memoryStoreevictionPolicy="LFU" /> </ehcache>

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念