ehcache.xml配置文件
<defaultCache
maxElementsInMemory="10000" //缓存中允许创建的最大对象数
eternal="false" //缓存中对象是否为永久的
timeToIdleSeconds="120"//缓存数据钝化时间(即对象在它过期前的空闲时间)
timeToLiveSeconds="120"//缓存数据生存时间(即对象在它过期前的生存时间)
overflowToDisk="true"
/>
定义一个缓存他的生存周期应该怎么计算。timeToIdleSeconds +timeToLiveSeconds吗?
生命周期就是 timeToLiveSeconds
timeToIdleSeconds 是从内存转到硬盘的时间。