Copy Code code as follows:
<?xml version= "1.0" encoding= "UTF-8"?>
<ehcache xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"
xsi:nonamespaceschemalocation= "Ehcache.xsd" updatecheck= "false"
monitoring= "AutoDetect" dynamicconfig= "true" >
<diskstore path= "Java.io.tmpdir"/>
<defaultcache maxelementsinmemory= "10000" eternal= "true"
Overflowtodisk= "true"
maxelementsondisk= "10000000" diskpersistent= "false"
diskexpirythreadintervalseconds= "memorystoreevictionpolicy=" "LRU"/>
</ehcache>
Name: Cached names.
Maxelementsinmemory: Maximum cache count.
Eternal: The object is permanently valid, but the timeout will not work.
Timetoidleseconds: The allowable idle time (in seconds) before the object is invalidated. When Eternal=false, the optional attribute, the default value is 0, that is, can idle time infinity.
Timetoliveseconds: The object is allowed to survive before it expires (in seconds). The maximum time is between the creation time and the expiration time. When Eternal=false is used, the default is 0, which means that the object survives indefinitely.
Overflowtodisk: When the number of objects in memory reaches Maxelementsinmemory, Ehcache writes the object to disk.
DISKSPOOLBUFFERSIZEMB: This parameter sets the buffer size of the Diskstore (disk cache). The default is 30MB. Each cache should have a buffer of its own.
Maxelementsondisk: Maximum number of hard disk cache.
Diskpersistent: The virtual machine Restart period data is cached, and the default value is False.
Diskexpirythreadintervalseconds: Disk failed thread run time interval, default is 120 seconds.
Memorystoreevictionpolicy: When the maxelementsinmemory limit is reached, Ehcache will clean up the memory according to the specified policy. The default policy is LRU (least recently used). You can set it to FIFO (first-in first Out) or LFU (less used).
Clearonflush: Clear when the maximum amount of memory is available.
<diskStore> indicates that the cache object is written to the hard disk when the number of objects in the memory cache exceeds the class setting memory cache, and path= "Java.io.tmpdir" indicates that the data is written to this directory. The Java.io.tmpdir directory is generated according to relative paths at run time.
<defaultCache> represents the default data expiration policy for setting the cache.
<cache> indicates that a data expiration policy with a specific named cache is set.