Just another blog.

Compressing content using a servlet filter

Java

One year and little bit more I was gzipping Spring remoting requests and responses. Now is time to gzip web application :-)

The simplest solution is to use filter in your web.xml. I found implementation in ehcache called net.sf.ehcache.constructs.web.filter.GzipFilter :-)

<filter>
 <filter-name>gzip</filter-name>
 <filter-class>net.sf.ehcache.constructs.web.filter.GzipFilter</filter-class>
</filter>

<filter-mapping>
 <filter-name>gzip</filter-name>
 <url-pattern>/*</url-pattern>
</filter-mapping>

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>