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

oscache.properties

 
阅读更多
Configuration:配置oscache.properties

1、cache.memory: true 或者 false。默认为true 不使用内存缓存而使用硬盘缓存是很愚蠢的事情。

2、cache.capacity 缓存object的最大数量值。默认是不限制,cache不会移走任何缓存内容。负数被当作不限制。

3、cache.algorithm 运算规则。为了使用规则,cache的size必须是指定的。 如果cache的size不指定的话,法则将不会限制缓存对象的大小。 如果你指定了cache的size,但不指定algorithm,那它会默认使用:com.opensymphony.oscache.base.algorithm.LRUCache 有下面三种规则: com.opensymphony.oscache.base.algorithm.LRUCache-last in first out,最迟插入的最先调用。默认值。 com.opensymphony.oscache.base.algorithm.FIFOCache -first int first out。 com.opensymphony.oscache.base.algorithm.UnlimitedCache -cache中的内容将永远不会被丢弃。 如果cache.capacity不指定值的话,它将被设为默认。

4、cache.blocking 是否同步化。true 或者 false。一般设为true,避免读取脏数据。

5。cache.unlimited.disk 指定硬盘缓存是否要作限制。默认值为false。false的状况下,disk cache capacity 将和cache.capacity的值相同。

6、cache.persistence.class 指定类是被持久化的类。class必须实现PersistenceListener接口。 作为硬盘持久,可以实现com.opensymphony.oscache.plugins.diskpersistence.HashDiskPersistenceListener接口。 它把class的toString()输出的hash值作为文件的名称。如果你要把文件名易读(自己设定),DiskPersistenceListener 的父类也 能使用,但其可能有非法字符或者过长的名字。 注意:HashDiskPersistenceListener 和 DiskPersistenceListener 需要设定硬盘路径:cache.path

7、cache.path 指定硬盘缓存的路径。目录如果不存在将被建立。同时注意oscache应该要有权限写文件系统。 cache.path=c:\\myapp\\cache or *ix: cache.path=/opt/myapp/cache

8、cache.persistence.overflow.only (NEW! Since 2.1) 指定是否只有在内存不足的情况下才使用硬盘缓存。 默认值false。但推荐是true如果内存cache被允许的话。这个属性彻底的改变了cache的行为,使得persisted cache 和memory完全不同。

9、cache.event.listeners 用逗号分离的class名列表。每个class必须实现以下接口之一,或者几个 CacheEntryEventListener:接收cache add/update/flush and remove事件 CacheMapAccessEventListener :接收cache访问事件。这个可以让你跟踪cache怎么工作。 默认是不配置任何class的。当然你可以使用一下的class: com.opensymphony.oscache.plugins.clustersupport.BroadcastingCacheEventListener -分布式的监听器。可以广播到局域网内的其他cache实例。 com.opensymphony.oscache.extra.CacheEntryEventListenerImpl -一个简单的监听器。在cache的生命周期中记录count of 所有entry的事件。 com.opensymphony.oscache.extra.CacheMapAccessEventListenerImpl -记录count of cache map events(cache hits,misses and state hits).

10、cache.key This is the key that will be used by the ServletCacheAdministrator (and hence the custom tags) to store the cache object in the application and session scope. The default value when this property is not specified is "__oscache_cache". If you want to access this default value in your code, it is available as com.opensymphony.oscache.base.Const.DEFAULT_CACHE_KEY.

11、cache.use.host.domain.in.key If your server is configured with multiple hosts, you may wish to add host name information to automatically generated cache keys. If so, set this property to true. The default value is false.

12、Additional Properties In additon to the above basic options, any other properties that are specified in this file will still be loaded and can be made available to your event handlers. For example, the JavaGroupsBroadcastingListener supports the following additional properties:

13、cache.cluster.multicast.ip The multicast IP to use for this cache cluster. Defaults to 231.12.21.132.

14、cache.cluster.properties Specifies additional configuration options for the clustering. The default setting is UDP(mcast_addr=231.12.21.132;mcast_port=45566;ip_ttl=32;\ mcast_send_buf_size=150000;mcast_recv_buf_size=80000):\ PING(timeout=2000;num_initial_members=3):\ MERGE2(min_interval=5000;max_interval=10000):\ FD_SOCK:VERIFY_SUSPECT(timeout=1500):\ pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800;max_xmit_size=8192):\ UNICAST(timeout=300,600,1200,2400):\ pbcast.STABLE(desired_avg_gossip=20000):\ FRAG(frag_size=8096;down_thread=false;up_thread=false):\ pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true)
分享到:
评论

相关推荐

    oscache缓存配置

    接着,我们需要配置osCache的行为,这通常通过oscache.properties文件实现。这个文件定义了缓存的各种参数,如缓存的默认过期时间、是否启用缓存更新通知等。例如,以下是一段基本的oscache.properties配置示例: `...

    基于OSCache的页面缓存(收藏)

    **基于OSCache的页面缓存技术详解** ...然后,在初始化阶段,通过配置文件(通常为`oscache.properties`)设置缓存的相关参数,如缓存大小、过期时间、是否启用持久化等。例如: ```properties # oscache.properties ...

    Hibernate OSCache缓存

    同时,需要一个 `oscache.properties` 配置文件,通常放在项目的 `src` 根目录或者发布环境的 `/WEB-INF/classes` 目录下。这个配置文件用于设置 OSCache 的各项参数,如缓存大小、过期策略等。 **2. Hibernate ...

    oscache.rar

    1. **配置文件**:OSCache的配置通常通过`oscache.properties`文件完成,包括缓存大小、过期策略、序列化方式、集群通信参数等。示例项目可能包含了不同的配置案例,展示如何在集群环境中配置OSCache。 2. **启动和...

    oscache缓存使用总结.doc

    获取`oscache.properties`文件,并将其放在`src`根目录或发布环境的`/WEB-INF/classes`目录下。如果需要启用磁盘缓存,需要修改`cache.path`属性,指定合适的缓存存储路径。 3. **标签库**: 将`oscache.tld`文件...

    Oscache-入门教程.doc

    1. **下载与安装**:从官方网站下载 OSCache,解压缩后将 `oscache.jar` 放入 `WEB-INF/lib` 目录,`oscache.properties` 和 `oscache.tld` 放入 `WEB-INF/classes` 目录。 2. **配置**:根据项目需求修改 `oscache...

    oscache说明

    2. 将 `oscache.properties` 和 `oscache.tld` 文件放入 `WEB-INF/classes` 目录。通常,这两个文件会放在项目的源代码目录(如 `src`),在构建过程中会被自动复制到 `WEB-INF/classes`。 3. 根据你的应用需求,...

    oscache,缓存机制的使用

    - `oscache.properties`包含了oscache运行所需的各项配置参数,如缓存的有效时间、缓存策略等。 - `oscache.tld`定义了oscache提供的标签库结构,便于在JSP页面中调用缓存相关的标签。 #### 3. 修改web.xml 在...

    OSCache使用说明

    3. 将 oscache.properties 文件放入应用的 src 根目录或 /WEB-INF/classes 目录,以便于配置缓存参数。 4. 如果需要集群缓存,需要添加 jgroups.jar 到类路径中。 5. 在 log4j.properties 中配置日志级别,如设置 ...

    OSCache使用文档

    - 如果使用的是JDK 1.4及以上版本,则需将`oscache.properties`文件从`src/etc`目录复制到`WEB-INF/classes`目录下。 4. **配置缓存属性文件:** 编辑`oscache.properties`文件,修改其中的`cache.path`属性以设置...

    OSCache简介

    在介绍 OSCache 的详细知识之前,我们先来看一下 `oscache.properties` 文件,这是 OS Cache 配置的核心部分。 `oscache.properties` 文件是 OSCache 的配置文件,它定义了缓存的行为、策略以及各种参数。以下是...

    oscache详细配置文档

    4. 如果需要,根据应用需求调整 `oscache.properties` 文件中的配置参数。 OSCache 还支持集群环境和主动缓存刷新等高级特性。开发者可以进一步阅读 OpenSymphony 官方网站提供的文档以获取更多信息,以充分利用这...

    OSCache需要的包

    `oscache.properties` 是OSCache的配置文件,它包含了缓存的设置参数,例如缓存的大小、过期策略、是否启用缓存更新监听器等。开发者可以通过修改这个文件来定制OSCache的行为,以适应不同的应用需求。 `oscache-...

    log4j.properties配置详解

    log4j.logger.com.opensymphony.oscache=ERROR log4j.logger.net.sf.navigator=ERROR log4j.logger.org.apache.commons=ERROR log4j.logger.org.apache.struts=WARN log4j.logger.org.displaytag=ERROR log4j.logger...

    Oscache框架的搭建步骤

    5. **配置属性文件**:在项目`src`目录下创建`oscache.properties`文件,用于设置Oscache的各种参数,如缓存策略、过期时间等。 6. **集成到JSP页面**:在JSP页面中引入Oscache标签库,使用`<%@taglib uri="oscache...

    Cache技术--OSCache

    - 将`oscache.properties`和`oscache.tld`放入`WEB-INF/classes`目录(或对应的源码目录,编译后自动复制到`WEB-INF/classes`)。 - 配置`oscache.properties`以设置缓存参数。 #### 2. 使用方法 - **缓存对象*...

    oscache文档

    配置 OSCache 时,将 `oscache.properties` 和 `oscache.tld` 以及 `oscache-2.1.1.jar` 复制到你的应用服务器的相应目录下。例如,如果你使用的是 Tomcat 5.0,这些文件应放在 `D:\Tomcat 5.0\webapps\ROOT\WEB-INF...

Global site tag (gtag.js) - Google Analytics