Sunday, May 6, 2007

Compressing Content Using a Servlet Filter

To increase performance of your web application use compression filters
You can obtain very effective compression by having a servlet filter conditionally pipe whatever your web application produces to a GZIP-compressed file.
Why GZIP? Because the HTTP protocol, the protocol used to transmit web pages, allows for GZIP compression.

GZIP compression will usually get you around a 6:1 compression ratio; it depends on how much content you are sending and what the content is. In practice, this means you will send content to a user up to six times faster if you simply use GZIP compression whenever you can.
There are following links where you will get code of Compression Filters

http://java.sun.com/products/servlet/Filters.html
http://www.thomas-bayer.com/gzip-compression-filter.htm

No comments: