Resin中配置GZip特性

Posted by Wayne Wan in About Work, Reviews on 25-07-2008

Tags: , ,

 resin中配置Gzip只需要在resin配置文件中加入一个filter即可,参数见下面的官方解释:

GzipFilter

The GzipFilter compresses the output of pages for browsers which understand compression, and leaves the output unchanged if the browser does not support compression. A browser indicates to the server that it supports gzip compression by including “gzip” in the “Accept-Encoding” request header.

GzipFilter is available in Resin-Professional.
use-vary    Set the standard HTTP “Vary” response header to “Accept-Encoding”. This indicates to the browser and any intervening cache that the response from this url might be different depending on the Accept-Encoding provided by the browser.    true
no-cache    Forbid the browser and any intervening cache from caching the results of this request. Sets the “Cache-Control” response header to “no-cache”. If use-vary is false then this is always true.    false
embed-error-in-output    Embed the stack trace of any exception into the output stream that is being sent to the browser.    false

<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>

See com.caucho.filters.GzipFilter.

Comments:

I’ve really enjoyed reading your articles. You obviously know what you are talking about! Your site is so easy to navigate too, I’ve bookmarked it in my favourites. . . . .

Well, this is my first visit to your blog! We are a group of volunteers and starting a new initiative in a community in the same niche. Your blog provided us valuable information to work on. You have done a marvellous job!

Very nice and helpful information has been given in this article. I like the way you explain the things. Keep posting. Thanks. . .

This post is usefull.

This is a great post.

Post a comment