• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
山高我为峰
博客园    首页    新随笔    联系   管理    订阅  订阅
ehcache.xml详解
<?xml version="1.0" encoding="UTF-8"?>
<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.
如果这个路径是Java System Property,那么这个路径就会被这个属性值所替代
     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 -->

    <!--Default Cache configuration. These will applied to caches programmatically created through
        the CacheManager.

        The following attributes are required:

        maxElementsInMemory            - 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.
                                                    设置元素是否永恒,如果永恒,那么将忽略超时限制并且该元素永远不会过期
        overflowToDisk                      - Sets whether elements can overflow to disk when the in-memory cache has reached the maxInMemory limit.
                                            设置在内存中的缓存达到打到最大的对象数时是否允许溢出到磁盘

        The following attributes are optional:
        timeToIdleSeconds            -     Sets the time to idle for an element before it expires.    
                                        设置元素过期之前的空闲时间                                    
                                                        i.e. The maximum amount of time between accesses before an
                                                        element expires Is only used if the element is not eternal.
                                                        Optional attribute. A value of 0 means that an Element can idle
                                                        for infinity.The default value is 0.
        timeToLiveSeconds              - Sets the time to live for an element before it expires.
                                        设置元素过期之前的时间
                                                         i.e. The maximum time between creation time and when an element
                                                         expires.  Is only used if the element is not eternal.
                                                         Optional attribute. A value of 0 means that and Element can live
                                                         for infinity.
                                                        The default value is 0.
        diskPersistent                           - Whether the disk store persists between restarts of the Virtual Machine.
                                                    在重启虚拟机后磁盘存储是否还存在
                                                         The default value is false.
        diskExpiryThreadIntervalSeconds   - The number of seconds between runs of the disk expiry thread.
                                            磁盘失效线程之间的运行秒数。
                                                         The default value  is 120 seconds.
        --> <diskStore path="/data/ehcache"/> <defaultCache maxElementsInMemory="10000" eternal="false" overflowToDisk="true" timeToIdleSeconds="120" timeToLiveSeconds="180" diskPersistent="false" diskExpiryThreadIntervalSeconds="60" /> <cache name="org.hibernate.cache.StandardQueryCache" maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="4200" overflowToDisk="true" /> <cache name="org.hibernate.cache.UpdateTimestampsCache" maxElementsInMemory="5000" eternal="true" timeToIdleSeconds="0" timeToLiveSeconds="0" overflowToDisk="false" /> </ehcache>

 

posted on 2015-09-28 16:44  山高我为峰  阅读(1166)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3