Skip to end of metadata
Go to start of metadata

Overview 

Optional GZIP content encoding can be enabled for responses, requests, or both.

Detail

Enabling GZIP response compression sets the 'Accept-Encoding' header of requests to 'gzip' and if the server supports this and GZIPs the response and sets the 'Content-Encoding' header on it to 'gzip' the client will decode it.  If the server does not support this non compressed responses are also handled.

Enabling GZIP request compression sets the 'Content-Encoding' header of requests to 'gzip' and compresses the content.  The server must support this in order for this to work because request encoding cannot be negotiated as response encoding is.

Examples

Client Use





Server Setup

There are a number of ways to enable content encoding on the server side.

Servlet Filter

The servlet filter used by xfire for testing is http://sourceforge.net/projects/pjl-comp-filter, on ibiblio it is http://www.ibiblio.org/maven2/net/sourceforge/pjl-comp-filter/pjl-comp-filter/ ; It supports request and response compression.

To set it up place jar in your servlet container and add the following to your web.xml




With this filter you can easily make a statistics jsp:




mod_deflate

One of many other ways is to use http://httpd.apache.org/docs/2.0/mod/mod_deflate.html.

Labels
  • None