博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
jpa-入门.缓存配置ehcache.xml
阅读量:4496 次
发布时间:2019-06-08

本文共 3172 字,大约阅读时间需要 10 分钟。

<ehcache>

    <!-- Sets the path to the directory where cache .data files are created.
         If the path is a Java System Property it is replaced by
         its value in the running VM.
         The following properties are translated:
         user.home - User's home directory
         user.dir - User's current working directory
         java.io.tmpdir - Default temp file path -->
    <diskStore path="java.io.tmpdir"/>
    <!--Default Cache configuration. These will applied to caches programmatically created through
        the CacheManager.
        The following attributes are required for defaultCache:
        maxInMemory       - Sets the maximum number of objects that will be created in memory
        eternal           - Sets whether elements are eternal. If eternal,  timeouts are ignored and the element
                            is never expired.
        timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only used
                            if the element is not eternal. Idle time is now - last accessed time
        timeToLiveSeconds - Sets the time to live for an element before it expires. Is only used
                            if the element is not eternal. TTL is now - creation time
        overflowToDisk    - Sets whether elements can overflow to disk when the in-memory cache
                            has reached the maxInMemory limit.
        -->
    <defaultCache
        maxElementsInMemory="10000"
        eternal="false"
        timeToIdleSeconds="120"
        timeToLiveSeconds="120"
        overflowToDisk="true"
        />
    <!--Predefined caches.  Add your cache configuration settings here.
        If you do not have a configuration for your cache a WARNING will be issued when the
        CacheManager starts
        The following attributes are required for defaultCache:
        name              - Sets the name of the cache. This is used to identify the cache. It must be unique.
        maxInMemory       - Sets the maximum number of objects that will be created in memory
        eternal           - Sets whether elements are eternal. If eternal,  timeouts are ignored and the element
                            is never expired.
        timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only used
                            if the element is not eternal. Idle time is now - last accessed time
        timeToLiveSeconds - Sets the time to live for an element before it expires. Is only used
                            if the element is not eternal. TTL is now - creation time
        overflowToDisk    - Sets whether elements can overflow to disk when the in-memory cache
                            has reached the maxInMemory limit.
        -->
    <!-- Sample cache named sampleCache1
        This cache contains a maximum in memory of 10000 elements, and will expire
        an element if it is idle for more than 5 minutes and lives for more than
        10 minutes.
        If there are more than 10000 elements it will overflow to the
        disk cache, which in this configuration will go to wherever java.io.tmp is
        defined on your system. On a standard Linux system this will be /tmp"
        -->
    <cache name="sampleCache1"
        maxElementsInMemory="10000"
        eternal="false"
        timeToIdleSeconds="300"
        timeToLiveSeconds="600"
        overflowToDisk="true"
        />
    <!-- Sample cache named sampleCache2
        This cache contains 1000 elements. Elements will always be held in memory.
        They are not expired. -->
    <cache name="sampleCache2"
        maxElementsInMemory="1000"
        eternal="true"
        timeToIdleSeconds="0"
        timeToLiveSeconds="0"
        overflowToDisk="false"
        /> -->
    <!-- Place configuration for your caches following -->
</ehcache>

转载于:https://www.cnblogs.com/lshan/p/8627358.html

你可能感兴趣的文章
Linux系统基础优化
查看>>
小程序开发快速入门教程(附源码)
查看>>
基于cropper.js的图片上传和裁剪
查看>>
车联网SaaS平台多租户平台技术选型参考
查看>>
我是如何快速积累工作经验
查看>>
用信号量进程同步与互斥
查看>>
随笔1
查看>>
Codeforces Round #469 (Div. 2)
查看>>
JavaScript:Number 对象
查看>>
事务同步多线程
查看>>
怎么去掉联系人、通话记录、拨号列表界面中的电话号码中间的空格?
查看>>
node.js常见的一些错误信息
查看>>
MySQL启动出现The server quit without updating PID file错误解决办法
查看>>
什么是多租户
查看>>
jQuery的效果
查看>>
express node 框架介绍
查看>>
adt-bundle-windows-x86-20131030
查看>>
Socket
查看>>
正则表达式之 数据验证 与 文本替换
查看>>
RPC是什么?
查看>>