<Ehcache xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: noNamespaceSchemaLocation = "../config/ehcache. xsd"> <diskStore path = "java. io. tmpdir"/> <! -- Mandatory Default Cache configuration. These settings will be applied to caches created programmtically using CacheManager. add (String cacheName) --> <! -- Name: cache name. MaxElementsInMemory: Maximum number of caches. Eternal: whether the object is permanently valid. Once set, timeout does not work. TimeToIdleSeconds: sets the allowable idle time before the object expires (unit: seconds ). This attribute is optional only when the eternal = false object is not permanently valid. The default value is 0, indicating that the idle time is infinite. TimeToLiveSeconds: sets the allowed lifetime of an object before it expires (unit: seconds ). The maximum time is between the creation time and the expiration time. It is used only when the eternal = false object is not permanently valid. The default value is 0. That is, the object survival time is infinite. OverflowToDisk: when the number of objects in the memory reaches maxElementsInMemory, Ehcache writes the objects to the disk. DiskSpoolBufferSizeMB: this parameter sets the cache size of DiskStore (disk cache. The default value is 30 MB. Each Cache should have its own buffer. MaxElementsOnDisk: Maximum number of Hard Disk caches. DiskPersistent: Indicates Whether to cache the data during VM restart. Whether the disk store persists between restarts of The Virtual Machine. the default value is false. diskExpiryThreadIntervalSeconds: the disk failure thread running interval. The default value is 120 seconds. MemoryStoreEvictionPolicy: When the maxElementsInMemory limit is reached, Ehcache clears 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 (rarely used ). ClearOnFlush: whether to clear when the maximum number of memory is exceeded. --> <DefaultCache maxElementsInMemory = "10000" eternal = "false" temperature = "120" timeToLiveSeconds = "120" overflowToDisk = "true" maxElementsOnDisk = "10000000" diskPersistent = "false" Temperature = "120" memoryStoreEvictionPolicy = "LRU"/> </ehcache>