查看完整版本: [-- GzipFilter requires Resin Professional --]

风信Java论坛 ›› Caucho Resin ›› GzipFilter requires Resin Professional 登录 -> 注册

1F GzipFilter requires Resin Professional   唧唧 Post by : 2008-07-03 17:46:05.0

resin-web.xml

xhtml代码
  1. <web-app xmlns="http://caucho.com/ns/resin"> 
  2.   <filter filter-name="gzip" 
  3.           filter-class="com.caucho.filters.GzipFilter"> 
  4.    <init> 
  5.      <use-vary>true</use-vary> 
  6.    </init> 
  7.   </filter> 
  8.  
  9.   <filter-mapping filter-name="gzip"> 
  10.     <url-pattern> 
  11.       <exclude-pattern>*.pdf</exclude-pattern> 
  12.       <include-pattern>/*</include-pattern> 
  13.     </url-pattern> 
  14.   </filter-mapping> 
  15. </web-app> 

init directives

Attribute Meaning Default
allow-content-type adds a content-type which should be compressed all
deny-content-type adds a content-type which should not be compressed none
use-vary Set the HTTP Vary header for Gzip requests true
no-cache Disable caching of GZip response false
embed-error-in-output Embeds any thrown exceptions in the gzip output false

If <allow-content-type> is specified, any unmatched content-type will not be compressed.

By:http://wiki.caucho.com/GzipFilter

2F    唧唧 Post by : 2008-07-03 17:46:44.0
Resin服务器的做法如下:

Resin 3.0.x

<web-app xmlns="http://caucho.com/ns/resin">
<filter filter-name="gzip" filter-class="com.caucho.filters.GzipFilter"/>
<filter-mapping url-pattern="/*" filter-name="gzip"/>
</web-app>

Resin 2.x

<web-app xmlns="http://caucho.com/ns/resin">
<filter filter-name="gzip" filter-class="com.caucho.http.filter.GzipFilter"/>
<filter-mapping url-pattern="/*" filter-name="gzip"/>
</web-app>

二者的差别只是GzipFilter所在的包不同而已!其他的应用服务器如果不支持压缩的话你也可以自己写GzipFilter来处理,可以参考resin的源码进行编写。
3F    唧唧 Post by : 2008-07-21 19:25:05.0
GZip是“GNU Zip”的缩写,是由Jean-loup Gailly开发的压缩方式。

顾名思义,“GZip加速”就是在页面由服务器传送向客户端之前先用GZip压缩,然后到客户端再进行解压操作,由于传输数据量大大减小,下载速度当然有所提高咯。不过目前宽带已经普及,这种技术并不会带来明显的速度提升(当然这一切都是我们所感觉不到的)。

风信Java论坛 ›› Caucho Resin ›› GzipFilter requires Resin Professional 登录 -> 注册

查看完整版本: [-- GzipFilter requires Resin Professional --]
CopyRight © 2008-2009 JavaWind.Net Studio All Rights Reserved
Powered By JWind.BBS Vesion 1.0.0 Beta1 Processed in 4 ms,0 (Queries)  Gzip enabled
粤ICP备07511478号