发表新主题 回复该帖子
主题:GzipFilter requires Resin Professional
唧唧
帖子档案  楼主 GzipFilter requires Resin Professional   Post by : 2008-07-03 17:46:05.0
  • 幼儿园
  • 幼儿园
  • UID:3
  • 主题:342
  • 帖子:781
  • 加为好友 加为好友    发送短信 发送短信

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

签名
 ★★★★★★★★
 纵里寻她千百度,蓦然回首,那人却在,灯火阑珊处!
 MyBlog :http://blog.javawind.net
返回页面顶部  

唧唧
2F Re:~   Post by : 2008-07-03 17:46:44.0
  • 幼儿园
  • 幼儿园
  • UID:3
  • 主题:342
  • 帖子:781
  • 加为好友 加为好友    发送短信 发送短信
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的源码进行编写。
签名
 ★★★★★★★★
 纵里寻她千百度,蓦然回首,那人却在,灯火阑珊处!
 MyBlog :http://blog.javawind.net
返回页面顶部  

唧唧
3F Re:~   Post by : 2008-07-21 19:25:05.0
  • 幼儿园
  • 幼儿园
  • UID:3
  • 主题:342
  • 帖子:781
  • 加为好友 加为好友    发送短信 发送短信
GZip是“GNU Zip”的缩写,是由Jean-loup Gailly开发的压缩方式。

顾名思义,“GZip加速”就是在页面由服务器传送向客户端之前先用GZip压缩,然后到客户端再进行解压操作,由于传输数据量大大减小,下载速度当然有所提高咯。不过目前宽带已经普及,这种技术并不会带来明显的速度提升(当然这一切都是我们所感觉不到的)。
签名
 ★★★★★★★★
 纵里寻她千百度,蓦然回首,那人却在,灯火阑珊处!
 MyBlog :http://blog.javawind.net
返回页面顶部  


CopyRight © 2008-2009 JavaWind.Net Studio All Rights Reserved
Powered By JWind.BBS Vesion 1.0.0 Beta1 Processed in 26 ms,0 (Queries)  Gzip enabled

WAP - 清除Cookies - 联系我们 - JavaWind.Net Studio - Archiver - TOP Valid XHTML 1.0 Transitional Valid CSS! 粤ICP备07511478号