`
changyehappy
  • 浏览: 18147 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

缓存配置ehcache.xml

 
阅读更多


<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:缓存名称。
       maxElementsInMemory:缓存最大个数。
       eternal:对象是否永久有效,一但设置了,timeout将不起作用。
       timeToIdleSeconds:设置对象在失效前的允许闲置时间(单位:秒)。仅当eternal=false对象不是永久有效时使用,可选属性,默认值是0,也就是可闲置时间无穷大。
       timeToLiveSeconds:设置对象在失效前允许存活时间(单位:秒)。最大时间介于创建时间和失效时间之间。仅当eternal=false对象不是永久有效时使用,默认是0.,也就是对象存活时间无穷大。
       overflowToDisk:当内存中对象数量达到maxElementsInMemory时,Ehcache将会对象写到磁盘中。
       diskSpoolBufferSizeMB:这个参数设置DiskStore(磁盘缓存)的缓存区大小。默认是30MB。每个Cache都应该有自己的一个缓冲区。
       maxElementsOnDisk:硬盘最大缓存个数。
       diskPersistent:是否缓存虚拟机重启期数据 Whether the disk store persists between restarts of the Virtual Machine. The default value is false.
       diskExpiryThreadIntervalSeconds:磁盘失效线程运行时间间隔,默认是120秒。
       memoryStoreEvictionPolicy:当达到maxElementsInMemory限制时,Ehcache将会根据指定的策略去清理内存。默认策略是LRU(最近最少使用)。你可以设置为FIFO(先进先出)或是LFU(较少使用)。
       clearOnFlush:内存数量最大时是否清除。
    -->
    <defaultCache
            maxElementsInMemory="10000"
            eternal="false"
            timeToIdleSeconds="120"
            timeToLiveSeconds="120"
            overflowToDisk="true"
            maxElementsOnDisk="10000000"
            diskPersistent="false"
            diskExpiryThreadIntervalSeconds="120"
            memoryStoreEvictionPolicy="LRU"
            />
</ehcache>
分享到:
评论

相关推荐

    shiro-ehcache.xml

    在maven项目中,此shiro-ehcache.xml配置文件放在resources下,在applicationContext.xml中,用于shiro缓存管理器所配置,然后给shiro安全管理器配置此缓存管理器

    ehcache的配置参数详解

    hibernate ehcache.xml 配置详解

    ehcache.xml

    hibernate 设置 二级缓存 配置文件

    mybatis ehcache 1.0 ehcache.xsd 提示文件

    mybatis 第三方二级缓存,ehcache 配置文件的 约束文件 ehcache.xsd !!

    借助Ehcache缓存框架实现对页面的缓存Demo

    1、ehcache.xml和ehcache.xsd两个文件可以在下在下载下来的名为“ehcache-core-x.x.x-distribution.tar.gz”压缩文件中找到 2、由于要实现Ehcache缓存页面,所以必须要添加“ehcache-web-2.0.4.jar” jar包,该jar包...

    springboot 整合ehcache+redis 通过配置文件切换缓存类型

    ehcache :添加依赖 pom.xml 2、添加配置文件ehcache.xml 3、添加注解@EnableCaching @Cacheable 4、插入缓存 5 读取缓存 6 设置缓存过期时间ehcache.xml --&gt;timeToLiveSeconds。 redis : 1、添加依赖 pom.xml 2、...

    ehcahe页面缓存详细内容

    2.将ehcache.xml放入能加载到classpath中的任意包中,不能放入WEB-INF中(其详细配置参数代表含义已经注释) 3.在工程中web.xml配置过滤器 &lt;filter-name&gt;SimplePageCachingFilter &lt;filter-class&gt;...

    ehcache-2.10.5.zip

    ehcache.xml 和 ehcache.xsd 版本是 ...在ehcache.xml 与 ehcache.xsd 放在同一目录下 配置如下 &lt;ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd"&gt;

    ehcache-failsafe.xml

    ehcache的缓存配置文件

    springboot整合ehcache 设置缓存过期时间 简单示例

    springboot 整合 ehcache 简单示例 1、添加依赖 pom.xml 2、添加配置文件ehcache.xml 3、添加注解@EnableCaching @Cacheable 4、插入缓存 5 读取缓存 6 设置缓存过期时间ehcache.xml --&gt;timeToLiveSeconds。

    Ehcache缓存配置

    详细描述了Ehcache缓存配置,本文将会对ehcache.xml配置文件进行详细的阐述。

    ehcache监控工具ehcache-monitor-kit-1.0.3

    将以下配置copy的ehcache.xml文件的ehcache标签中,注:上述链接中说的配置少写了个probe包名。 &lt;cacheManagerPeerListenerFactory class="org.terracotta.ehcachedx.monitor.probe.ProbePeerListenerFactory" ...

    jfinal缓存demo 及jar包

    final缓存机制,所需jar包,配置文件ehcache.xsd,ehcache.xml.

    Ehcache使用

    默认的配置文件为ehcache.xml文件,也可以使用不同的配置: CacheManager manager = new CacheManager("src/config/other.xml"); 缓存的创建,采用自动的方式 CacheManager singletonManager = CacheManager....

    ehcache 缓存

    <?xml version="1.0" encoding="UTF-8"?> <ehcache>  <diskStore path="java.io.tmpdir"/>    maxElementsInMemory="10000" !-- 缓存最大数目 -->  eternal="false" !-- 缓存是否持久 -->  ...

    spring+shiro+ehcache例子

    在web.xml中配置log4j信息打印 (需要自己将log4j的配置文件给打开) 三: 配置文件 查看/src/config/ ,配置文件可观察文件名称理解 四: 登录名为2:可以进行权限的验证,以及shiro的缓存。 登录名为任意...

    J2Cache两级缓存框架-其他

    ehcache.xml Ehcache的配置文件,配置说明请参考Ehcache文档 ehcache3.xml Ehcache3的配置文件,配置说明请参考Ehcache文档 network.xml JGroups网络配置,如果使用JGroups组播的话需要这个文件,一般无需修改 实际...

    Spring+MyBatis/Hibernate+Ehcache+Maven的Demo Web项目(稳定版)

    3.Ehcache方法缓存及页面缓存。见applicationContext-cache.xml及web.xml的pageEhCacheFilter 4.MyBatis+Maven代码生成工具。见bin目录 5.作为项目或者技术研究的基础架构。必要的jar包依赖都已配置好,基本都采用较...

    ehcache rmi集群demo

    ehcahce通过RMI方式进行集群的demo,myeclipse导入后直接可以运行。

    hibernate基础教程

    在配置文件中加入EhCache缓存插件的实现类. 第二步:拷贝ehcache.xml文件到类路径下(位于Hibernate3的etc文件夹下) 第三步:对需要进行缓存的持久化对象进行配置. 第四步:编写测试类,体验...

Global site tag (gtag.js) - Google Analytics