ehcache-core-2.5.2配置

 

  
  
  
  
  1. <?xml version="1.0" encoding="UTF-8"?> 
  2. <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  3.          xsi:noNamespaceSchemaLocation="ehcache.xsd" 
  4.          updateCheck="true" monitoring="autodetect" 
  5.          dynamicConfig="true"> 
  6.           
  7.     <diskStore path="java.io.tmpdir"/> 
  8.      
  9.     <defaultCache 
  10.            maxEntriesLocalHeap="10000" 
  11.            eternal="false" 
  12.            overflowToDisk="true" 
  13.            timeToIdleSeconds="20" 
  14.            timeToLiveSeconds="60"> 
  15.     </defaultCache> 
  16.  
  17.     <!-- 
  18.     Sample cache named sampleCache1 
  19.     This cache contains a maximum in memory of 10000 elements, and will expire 
  20.     an element if it is idle for more than 5 minutes and lives for more than 
  21.     10 minutes. 
  22.  
  23.     If there are more than 10000 elements it will overflow to the 
  24.     disk cache, which in this configuration will go to wherever java.io.tmp is 
  25.     defined on your system. On a standard Linux system this will be /tmp" 
  26.     --> 
  27.     <cache name="sampleCache1" 
  28.            maxEntriesLocalHeap="10000" 
  29.            maxEntriesLocalDisk="1000" 
  30.            eternal="false" 
  31.            overflowToDisk="true" 
  32.            diskSpoolBufferSizeMB="20" 
  33.            timeToIdleSeconds="300" 
  34.            timeToLiveSeconds="600" 
  35.            memoryStoreEvictionPolicy="LFU" 
  36.            transactionalMode="off" 
  37.             /> 
  38.              
  39.     <!-- 
  40.     Sample cache named sampleCache2 
  41.     This cache has a maximum of 1000 elements in memory. There is no overflow to disk, so 1000 
  42.     is also the maximum cache size. Note that when a cache is eternal, timeToLive and 
  43.     timeToIdle are not used and do not need to be specified. 
  44.     --> 
  45.     <cache name="sampleCache2" 
  46.            maxEntriesLocalHeap="1000" 
  47.            eternal="true" 
  48.            overflowToDisk="false" 
  49.            memoryStoreEvictionPolicy="FIFO" 
  50.             /> 
  51.  
  52.     <!-- 
  53.     Sample cache named sampleCache3. This cache overflows to disk. The disk store is 
  54.     persistent between cache and VM restarts. The disk expiry thread interval is set to 10 
  55.     minutes, overriding the default of 2 minutes. 
  56.     --> 
  57.     <cache name="sampleCache3" 
  58.            maxEntriesLocalHeap="500" 
  59.            eternal="false" 
  60.            overflowToDisk="true" 
  61.            timeToIdleSeconds="300" 
  62.            timeToLiveSeconds="600" 
  63.            diskPersistent="true" 
  64.            diskExpiryThreadIntervalSeconds="1" 
  65.            memoryStoreEvictionPolicy="LFU" 
  66.             /> 
  67. </ehcache> 

摘自:JFinal-1.1.1-lib.zip

官方配置文件参考: http://ehcache.org/ehcache.xml

你可能感兴趣的:(配置)