`
anrry
  • 浏览: 37888 次
  • 性别: Icon_minigender_2
  • 来自: 湖南
文章分类
社区版块
存档分类
最新评论

ehcache的配置参数详解

阅读更多

<defaultCache
             maxElementsInMemory="10000"
            //缓存中最大允许创建的对象数
             eternal="false"
            //缓存中对象是否为永久的,如果是,超时设置将被忽略,对象从不过期
             timeToIdleSeconds="120"
            //缓存数据钝化时间(设置对象在它过期之前的空闲时间)
             timeToLiveSeconds="120"
             //缓存数据的生存时间(设置对象在它过期之前的生存时间)
             overflowToDisk="true"
             //内存不足时,是否启用磁盘缓存
  />
 
<diskStore>表示当内存缓存中对象数量超过类设置内存缓存数量时,将缓存对象写到硬盘,path=”java.io.tmpdir”表示把数据写到这个目录下。Java.io.tmpdir目录在运行时会根据相对路径生成。
<defaultCache>表示设定缓存的默认数据过期策略。
<cache>表示设定用具体的命名缓存的数据过期策略。
name表示具体的缓存命名。
maxElementsInMemory表示cache中最大允许保存的对象数据量。
eternal表示cache中数据是否为常量。
timeToIdleSeconds表示缓存数据钝化时间
timeToLiveSeconds表示缓存数据的生命时间。

 

 

 

 

 

 

 

 

 

 

 

 
overflowToDisk表示内存不足时,是否启用磁盘缓存。

 

 

<ehcache>
 <diskStore path="java.io.tmpdir" />
 <defaultCache maxElementsInMemory="1000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120"
  overflowToDisk="true" />
 <cache name="org.hibernate.cache.StandardQueryCache" maxElementsInMemory="1000" eternal="false"
  timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true" />
 <cache name="org.hibernate.cache.UpdateTimestampsCache" maxElementsInMemory="1000" eternal="false"
  timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true" />

 <!-- bean cache configuration -->
 <cache name="com.ou.entity.Biz" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.BizConfig" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.BizOrder" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.BookItem" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.Callboard" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.CallMemo" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.CardType" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.Classroom" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.Config" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.Course" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.CourseType" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.EmailConfirm" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.Image" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.MemberLog" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.MemberCount" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.MemberOrder" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.MembershipCard" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.SystemProduct" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.SystemProductType" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.Task" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.TaskType" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.Template" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.TemplateType" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.User" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.UserLog" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 <cache name="com.ou.entity.UserPart" maxElementsInMemory="100" eternal="false" timeToIdleSeconds="3600"
  timeToLiveSeconds="7200" overflowToDisk="true" /> 
 
 <!-- application cache configuration -->
</ehcache>

 

分享到:
评论

相关推荐

    基于 SpringBoot 2.3.4 版本的入门 Demo 教程

    Spring Boot 配置文件详解 Spring Boot RESTful API 架构 Spring Boot 过滤器和拦截器 Spring Boot 全局异常处理 Spring Boot 参数校验 Spring Boot OpenAPI 文档集成 Spring Boot 集成 Mybatis Spring Boot 集成 ...

    J2EE spring mvc mybatis bootstrap HTML5 后台框架 控制台 mysql版本_spring3.0

    23.ehcache 自定义二级缓存 ,选择缓存存放目录,处理并发,增加系统性能 24.服务器内部GET POST 请求 25.uploadify 上传插件,单条、批量上传,带进度条,异步,图片、视频, 其它文件格式均可上传 26.地图选点获取...

    J2EE spring mvc mybatis bootstrap HTML5 后台框架 控制台 oracle版本_spring3.0

    23.ehcache 自定义二级缓存 ,选择缓存存放目录,处理并发,增加系统性能 24.服务器内部GET POST 请求 25.uploadify 上传插件,单条、批量上传,带进度条,异步,图片、视频, 其它文件格式均可上传 26.地图选点获取...

    基于springboot,采用mybatis和mapper3插件,基于shiro的sso cookies单机实现+源代码+文档说

    7. 切换配置文件 **application.properties** 设置参数 8. 访问`http://localhost:8082/api`可以查看项目的接口情况。(打开/关闭 com.zyf.other.api.config.SwaggerConfig)。 9. 使用 html,基本使用 ajax 异步...

    java开源包1

    集中管理请求参数与参数映射 以运行时异常的方式来管理错误的响应 使用泛型来做强类型编程 多协议扩展支持(REST, RPC, SOAP, etc) Rails3消息队列系统 Sidekiq Sidekiq 为 Rails 3 应用程序提供一个高效的消息...

    java开源包11

    集中管理请求参数与参数映射 以运行时异常的方式来管理错误的响应 使用泛型来做强类型编程 多协议扩展支持(REST, RPC, SOAP, etc) Rails3消息队列系统 Sidekiq Sidekiq 为 Rails 3 应用程序提供一个高效的消息...

    java开源包2

    集中管理请求参数与参数映射 以运行时异常的方式来管理错误的响应 使用泛型来做强类型编程 多协议扩展支持(REST, RPC, SOAP, etc) Rails3消息队列系统 Sidekiq Sidekiq 为 Rails 3 应用程序提供一个高效的消息...

    java开源包3

    集中管理请求参数与参数映射 以运行时异常的方式来管理错误的响应 使用泛型来做强类型编程 多协议扩展支持(REST, RPC, SOAP, etc) Rails3消息队列系统 Sidekiq Sidekiq 为 Rails 3 应用程序提供一个高效的消息...

    java开源包6

    集中管理请求参数与参数映射 以运行时异常的方式来管理错误的响应 使用泛型来做强类型编程 多协议扩展支持(REST, RPC, SOAP, etc) Rails3消息队列系统 Sidekiq Sidekiq 为 Rails 3 应用程序提供一个高效的消息...

    java开源包5

    集中管理请求参数与参数映射 以运行时异常的方式来管理错误的响应 使用泛型来做强类型编程 多协议扩展支持(REST, RPC, SOAP, etc) Rails3消息队列系统 Sidekiq Sidekiq 为 Rails 3 应用程序提供一个高效的消息...

    java开源包10

    集中管理请求参数与参数映射 以运行时异常的方式来管理错误的响应 使用泛型来做强类型编程 多协议扩展支持(REST, RPC, SOAP, etc) Rails3消息队列系统 Sidekiq Sidekiq 为 Rails 3 应用程序提供一个高效的消息...

    java开源包4

    集中管理请求参数与参数映射 以运行时异常的方式来管理错误的响应 使用泛型来做强类型编程 多协议扩展支持(REST, RPC, SOAP, etc) Rails3消息队列系统 Sidekiq Sidekiq 为 Rails 3 应用程序提供一个高效的消息...

    java开源包8

    集中管理请求参数与参数映射 以运行时异常的方式来管理错误的响应 使用泛型来做强类型编程 多协议扩展支持(REST, RPC, SOAP, etc) Rails3消息队列系统 Sidekiq Sidekiq 为 Rails 3 应用程序提供一个高效的消息...

    java开源包7

    集中管理请求参数与参数映射 以运行时异常的方式来管理错误的响应 使用泛型来做强类型编程 多协议扩展支持(REST, RPC, SOAP, etc) Rails3消息队列系统 Sidekiq Sidekiq 为 Rails 3 应用程序提供一个高效的消息...

    java开源包9

    集中管理请求参数与参数映射 以运行时异常的方式来管理错误的响应 使用泛型来做强类型编程 多协议扩展支持(REST, RPC, SOAP, etc) Rails3消息队列系统 Sidekiq Sidekiq 为 Rails 3 应用程序提供一个高效的消息...

    java开源包101

    集中管理请求参数与参数映射 以运行时异常的方式来管理错误的响应 使用泛型来做强类型编程 多协议扩展支持(REST, RPC, SOAP, etc) Rails3消息队列系统 Sidekiq Sidekiq 为 Rails 3 应用程序提供一个高效的消息...

    Java资源包01

    集中管理请求参数与参数映射 以运行时异常的方式来管理错误的响应 使用泛型来做强类型编程 多协议扩展支持(REST, RPC, SOAP, etc) Rails3消息队列系统 Sidekiq Sidekiq 为 Rails 3 应用程序提供一个高效的消息...

Global site tag (gtag.js) - Google Analytics