ehcache simple configuration

<?xml version="1.0" encoding="UTF-8"?>
<ehcache dynamicConfig="true">

    <-! Disk cache location ->
    <diskStore path="/files/cache"/>

    <-! Reverse proxy cache ->
    <! - the maximum number of buffers that can be used maxBytesLocalDisk disk bytes, which unit can be K, M or G. The default is 0, which indicates no limit. Only available in stand-alone environment, local disk ->
    <- timeToLiveSeconds:! Survival time of the object, the object refers to the time from creation to fail needs. Only the eternal is false is valid. The default value is 0, which means you can have access. (Unit: seconds) ->
    <- timeToIdleSeconds:! When an object is idle, it refers to how long the object will fail in not being accessed. Only the eternal is false is valid. The default value is 0. (Unit: seconds) ->
    <-! Eternal, if true, the cached data is always valid ->
    <! - buffer size diskSpoolBufferSizeMB (disk cache) of. The default is 30MB ->
    <-! OverflowToDisk if the data memory exceeds the memory limit, if you want to cache to disk ->
    <-! DiskPersistent whether persisted on disk. Refers JVM restart after the data is valid ->
    <-! MemoryStoreEvictionPolicy If the in-memory data exceeds the memory limits, the timing of the disk cache policy default is LRU ->
    <cache name="scorpiocache"
           maxBytesLocalDisk="500M"
           maxBytesLocalHeap="100M"
           timeToIdleSeconds="0"
           timeToLiveSeconds="0"
           eternal="true"
           diskSpoolBufferSizeMB="100"
           overflowToDisk="true"
           diskPersistent="true"
           memoryStoreEvictionPolicy="LRU"/>

  

Guess you like

Origin www.cnblogs.com/brxHqs/p/11612848.html