Ehcache. xml configuration details and examples in ehcache

Source: Internet
Author: User

<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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.