oscache配置详解

OScache配置 OScache配置 缓存技术 一、缓存整个页面 在 OSCache组件中提供了一个CacheFilter用于实现页面级的缓存,主要用于对web应用中的某些动态页面进行缓存,尤其是那些需要生成PDF 格式文件/报表、图片文件等的页面,不仅减少了数据库的交互、减少数据库服务器的压力,而且对于减少web服务器的性能消耗有很显著的效果。 这种功能的实现是通过在web.xml中进行配置来决定缓存哪一个或者一组页面,而且还可以设置缓存的相关属性,这种基于配置文件的实现方式对于J2EE来说应该是一种标准的实现方式了。 [注] 只有客户访问时返回http头信息中代码为200(也就是访问已经成功)的页面信息才能够被缓存。 修改web.xml,增加如下内容,确定对/testContent.jsp页面进行缓存。 <filter> ... 立即下载
 

#一、内存缓存或硬盘、数据库缓存
cache.memory=false

#二、缓存的最大数量。默认是不限制,cache不会移走任何缓存内容。负数被视不限制。
cache.capacity=100

#三、运算规则。为了使用规则,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不指定值的话,它将被设为默认选项。
cache.algorithm=com.opensymphony.oscache.base.algorithm.LRUCache

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

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

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

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

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

#九、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的生命周期中记录所有entry的事件。
#* com.opensymphony.oscache.extra.CacheMapAccessEventListenerImpl : 记录count of cache map events(cache hits,misses and state hits).
#cache.event.listeners

#十、在application 和 session的作用域时 用于标识cache 对象的,&nbsp; 用于ServletCacheAdministrator;此属性不是指定为"__oscache_cache"格式时为默认值, 如果代码中需要用到默认值时可以通使用com.opensymphony.oscache.base.Const.DEFAULT_CACHE_KEY 来取得;
cache.key=__oscache_cache

#十一、当配置多个服务器时,想通过服备器名称自动生成cache key时,可将此属性设为true. 默认值为false;
cache.use.host.domain.in.key=true

#十二、 在以上基础选项之上可以加入一些额外的属性到此文件中.例:&nbsp; JavaGroupsBroadcastingListener 便是额外的
#Additional Properties

#十三、用于缓存集群. 默认为231.12.21.132
#cache.cluster.multicast.ip

#十四、 指集群中的额外配置项. 以下是默认设置:(此属性的相关说将在集群文档中说明)
#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)
#cache.cluster.properties


# CACHE IN MEMORY
#
# If you want to disable memory caching, just uncomment this line.
#
# cache.memory=false


# CACHE KEY
#
# This is the key that will be used to store the cache in the application
# and session scope.
#
# If you want to set the cache key to anything other than the default
# uncomment this line and change the cache.key
#
# cache.key=__oscache_cache


# USE HOST DOMAIN NAME IN KEY
#
# Servers for multiple host domains may wish to add host name info to
# the generation of the key.  If this is true, then uncomment the
# following line.
#
# cache.use.host.domain.in.key=true


# CACHE LISTENERS
#
# These hook OSCache events and perform various actions such as logging
# cache hits and misses, or broadcasting to other cache instances across a cluster.
# See the documentation for further information.
#
# cache.event.listeners=com.opensymphony.oscache.plugins.clustersupport.JMSBroadcastingListener,  \
#                       com.opensymphony.oscache.extra.CacheEntryEventListenerImpl,               \
#                       com.opensymphony.oscache.extra.CacheMapAccessEventListenerImpl,           \
#                       com.opensymphony.oscache.extra.ScopeEventListenerImpl,                    \
#                       com.opensymphony.oscache.extra.StatisticListenerImpl


# CACHE PERSISTENCE CLASS
#
# Specify the class to use for persistence. If you use the supplied DiskPersistenceListener,
# don't forget to supply the cache.path property to specify the location of the cache
# directory.
#
# If a persistence class is not specified, OSCache will use memory caching only.
#
# cache.persistence.class=com.opensymphony.oscache.plugins.diskpersistence.DiskPersistenceListener
# cache.persistence.class=com.opensymphony.oscache.plugins.diskpersistence.HashDiskPersistenceListener

# CACHE OVERFLOW PERSISTENCE
# Use persistent cache in overflow or not. The default value is false, which means
# the persistent cache will be used at all times for every entry.  true is the recommended setting.
#
# cache.persistence.overflow.only=true

# CACHE DIRECTORY
#
# This is the directory on disk where caches will be stored by the DiskPersistenceListener.
# it will be created if it doesn't already exist. Remember that OSCache must have
# write permission to this directory.
#
# Note: for Windows machines, this needs \ to be escaped
# ie Windows:
# cache.path=c:\\myapp\\cache
# or *ix:
# cache.path=/opt/myapp/cache
#
# cache.path=c:\\app\\cache


# CACHE ALGORITHM
#
# Default cache algorithm to use. Note that in order to use an algorithm
# the cache size must also be specified. If the cache size is not specified,
# the cache algorithm will be Unlimited cache.
#
# cache.algorithm=com.opensymphony.oscache.base.algorithm.LRUCache
# cache.algorithm=com.opensymphony.oscache.base.algorithm.FIFOCache
# cache.algorithm=com.opensymphony.oscache.base.algorithm.UnlimitedCache

# THREAD BLOCKING BEHAVIOR
#
# When a request is made for a stale cache entry, it is possible that another thread is already
# in the process of rebuilding that entry. This setting specifies how OSCache handles the
# subsequent 'non-building' threads. The default behaviour (cache.blocking=false) is to serve
# the old content to subsequent threads until the cache entry has been updated. This provides
# the best performance (at the cost of serving slightly stale data). When blocking is enabled,
# threads will instead block until the new cache entry is ready to be served. Once the new entry
# is put in the cache the blocked threads will be restarted and given the new entry.
# Note that even if blocking is disabled, when there is no stale data available to be served
# threads will block until the data is added to the cache by the thread that is responsible
# for building the data.
#
# cache.blocking=false

# CACHE SIZE
#
# Default cache size in number of items. If a size is specified but not
# an algorithm, the cache algorithm used will be LRUCache.
#
#cache.capacity=1000


# CACHE UNLIMITED DISK
# Use unlimited disk cache or not. The default value is false, which means
# the disk cache will be limited in size to the value specified by cache.capacity.
#
# cache.unlimited.disk=false


# JMS CLUSTER PROPERTIES
#
# Configuration properties for JMS clustering. See the clustering documentation
# for more information on these settings.
#
#cache.cluster.jms.topic.factory=java:comp/env/jms/TopicConnectionFactory
#cache.cluster.jms.topic.name=java:comp/env/jms/OSCacheTopic
#cache.cluster.jms.node.name=node1


# JAVAGROUPS CLUSTER PROPERTIES
#
# Configuration properites for the JavaGroups clustering. Only one of these
# should be specified. Default values (as shown below) will be used if niether
# property is set. See the clustering documentation and the JavaGroups project
# (www.javagroups.com) for more information on these settings.
#
#cache.cluster.properties=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)
#cache.cluster.multicast.ip=231.12.21.132

oscache缓存配置 NULL 博文链接:https://yanxiansheng.iteye.com/blog/1636690 立即下载

相关推荐

双目立体成像(一)双目图片生成点云

利用左右目图片生成点云

qq_62964142的博客 4549

OSCache配置

一、缓存整个页面           在 OSCache组件中提供了一个CacheFilter用于实现页面级的缓存,主要用于对web应用中的某些动态页面进行缓存,尤其是那些需要生成PDF 格式文件/报表、图片文件等的页面,不仅减少了数据库的交互、减少数据库服务器的压力,而且对于减少web服务器的性能消耗有很显著的效果。   这种功能的实现是通过在web.xml中进行配置来决定缓存哪一个或者一组

操千曲而后晓声,观千剑而后识器 590

反制反心理特征的研究

抓牛股

m0_58032574的博客 908

用OSCache提升J2EE系统运行性能

文章摘要   Cache是一种用于提高系统响应速度、改善系统运行性能的技术。尤其是在Web应用中,通过缓存页面的输出结果,可以很显著的改善系统运行性能。本文中 作者给大家介绍一个实现J2EE框架中Web应用层缓存功能的开放源代码项目----OSCache。通过应用OSCache,我们不但可以实现通常的 Cache功能,还能够改善系统的稳定性。1 面临的问题1.1 需要处理的特殊动态

leagle 936

【机械视觉】Halcon—【二、Halcon算子全面介绍(超详细版)】

Halcon 的算子(operators)按照功能被系统性地划分为多个类别,官方文档中目前(Halcon 22.11 版本)共有 19 个主分类,每个主分类下还有若干子分类。 本人在此对这19个分类的常用核心算子进行了一系列的总结,且本人在文章最后还总结了一些案例经验。 注意: ​​​​​​​跨分类调用:某些算子可能在多个分类中,但官方文档中会明确其主分类。 例如: read_image(文件操作)常被其他分类(如图像处理)的示例调用,但其核心功能是文件读取。

qq_3517289697的博客 3913

电子工程师日记:用STM32F4的DCMI接口驱动OV2640时,那些数据同步的坑我都踩过了

本文分享了使用STM32F4的DCMI接口驱动OV2640摄像头时,在数据同步方面遇到的典型问题与解决方案。作者通过示波器分析PCLK相位、纠正DCMI_CR寄存器中同步信号极性的配置误区,并排查DMA传输瓶颈与FIFO溢出,最终实现了稳定的图像采集。文章为嵌入式工程师提供了宝贵的硬件调试经验与配置清单。

weixin_29189377的博客 156

osCache作为全局页面缓存的说明

oscache.properties文件配置 1、cache.memory 是否使用内存缓存;值为:true或false。默认为true;如设置为false,那cache只能缓存到数据库或硬盘中。 2、cache.capacity 缓存的最大数量。默认是不限制,cache不会移走任何缓存内容。负数被视不限制。 3、cache.algorithm 运算规则。为了使用规则,cache的size必须是...

domain.5忘初心 179

Yolov5自定义图片训练测试及模型调优(详细过程)

Yolov5自定义数据训练及测试1. 图像数据获取、标注2. 数据集划分及准备3. 配置训练参数,准备训练:3.1 修改data/训练配置xxx.yaml文件:3.2 修改models模型配置xxx.yaml文件4. 开始训练5. 测试训练后的模型: 1. 图像数据获取、标注 如果自定义训练自己的数据集,首先需要数据标注,至于数据来源可以是下载现有的开发数据集、拍照、爬虫等等。 如果是拍照、爬虫等获取的数据图片,需要进行数据标注,这个过程可以使用工具来做,但也需要一些手动操作 。。并且图片越多越好,如果

HowieXue 薛永浩的博客 10万+

OSCache配置参数说明

oscache.properties  osCache的配置文件,放在 webapp/WEB-INF/classes/下;oscache.properties 中的配置项如下:1、cache.memory原文:   Valid values are true or false, with true being the default value. If you want to disable me...

既是过河之卒,惟有奋力向前。 272

【CC精品教程】iTwin capture倾斜摄影建模完整操作流程

【CC精品教程】iTwin capture倾斜摄影建模完整操作流程。包括:无人机航测外业作业流程(像控点布设、航线规划、仿地飞行、航拍)和内业数据处理软件(Pix4d、CC、EPS、PhotoScan、Globalmapper)像控点权重调配、空三加密、DOM、DSM、DEM,DLG生成、等高线生成、高程点提取,点云分类过滤分割、点云生成DEM、三维模型生成等。

智慧空间实验室 3955

Python库CloudScraper详细使用(绕过 Cloudflare 的反机器人页面的 Python 模块)

CloudScraper是一个专门用于绕过Cloudflare反机器人保护的Python库,它基于requests库构建,能够处理Cloudflare的5秒盾、WAF和人机验证等防护机制。

数据知道的博客 1万+

oscache.properties 配置说明

 oscache.properties  osCache的配置文件   放在 webapp/WEB-INF/classes/下; oscache.properties 中的配置项如下: 1、cache.memory:   原文:      Valid values are true or false, with true being the defa

必应@珠峰 1001

020、Sensor 供电设计:AVDD、DVDD、IOVDD 的上电时序与纹波要求

本文总结了图像传感器(Sensor)供电设计中的关键要点与常见问题:1. 三路供电特性差异:AVDD(模拟供电)对纹波最敏感(通常<30mVpp),DVDD需应对大电流瞬态变化,IOVDD需满足MIPI接口电压稳定要求。2. 上电时序至关重要,应遵循"模拟→数字→IO"的启动顺序,时序偏差可能导致初始化失败。3. 纹波控制需合理选择电容组合(如10μF+0.1μF),注意布局走线及电容ESR/ESL特性。4. 调试建议使用示波器多通道测量时序和纹波,重点关注传感器启动瞬间的电源特性。5. 经验教训包括预留设

sundong_81的博客 522

OSCache的使用及配置

<br /> <br />配置OSCache缓存步骤:<br />1.把oscache.properties文件放到src目录下边,然后把commons-logging-X.X.jar和oscache-2.4.jar包拷贝到lib目录下<br />2.使用标签用<%@ taglib uri="http://www.opensymphony.com/oscache" prefix="cache" %><br />  <cache:cache key="" scope="" time="" refresh="t

java闲扯淡 250

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

OScache的安装与配置

1 环境要求         OSCache2.2要求JDK1.4和 Servlet 2.3。 2 安装         (1)从http://www.opensymphony.com/oscache/下载合适的OSCache版本,当前是oscache-2.0.2-full版本。         (2)将Zip文件解压缩到c:\oscache(后面的章节中将使用%OSCache_Home%

pan-zy的专栏 817

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

OsCache配置

jacky写于2006年广州花了一点时间,翻译了OsCache的配置属性:E文地址:http://wiki.opensymphony.com/display/CACHE/Configuration简洁翻译如下:后面部分懒得去翻译了...哈哈Configuration:配置oscache.properties1、cache.memory:true 或者 false...

anmishi2025的博客 159

osCache 配置说明

osCache 配置说明 作者: onebodysoftware@hotmail.com (MSN)   E文地址:http://wiki.opensymphony.com/display/CACHE/Configuration 这个东西今天小试了一下,总体感觉还不错.就不知道比起JBoss cache 有没什么差别(现在本人还不得而知啊) 主要是针对 osCach

一个人的软件艺术 3683

osCache缓存配置

oscache.properties  osCache 的配置文件    放在 webapp/WEB-INF/classes/ 下 ;   oscache.properties 中的配置项如下 :   1 、 cache.memory :    原文 :       Valid values are true or false, with true being the de...

itsnack 219

MyBatis3 配置OSCache

配置步骤很简单,大概分为: 1、

nano-dhh 1493

OSCache安装配置

OSCache是当前运用最广的缓存方案,JBoss,Hibernate,Spring等都对其有支持,下面简单介绍一下OSCache的配置和使用过程。1.安装过程从http://www.opensymphony.com/oscache/download.html下载合适的OSCache版本,从解压缩目录取得oscache.jar 文件放到 /WEB-INF/lib 或相应类库目录 目录中

黄瓜和土豆的专栏 1382

OSCache入门配置

OSCache是一个开放式资源缓冲库,可从http://www.opensymphony.com/oscache免费下载。我用的是2.41版,它包括一组JSP的标签,通过它们可以很容易的在你的程序中实现页面缓存,同时,还可以使用它的过滤器,可缓冲的不仅仅是JSP页面,还可以缓存任何Servlet生成的内容。    下面先介绍一下它的一些术语:    缓冲记录:存储在页面缓存器内的对象称为一个缓

javahepeng的专栏 479
上一篇: js提示“尚未实现”错误
下一篇: db2常用命令大全
jw607
博客等级 码龄19年 9粉丝 7原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值