xpj's knowledge base » Web http://www.xpj.cz/expee Just another blog. Wed, 03 Nov 2010 10:24:22 +0000 en hourly 1 Compressing content using a servlet filter http://www.xpj.cz/expee/2010/11/compressing-content-using-a-servlet-filter/ http://www.xpj.cz/expee/2010/11/compressing-content-using-a-servlet-filter/#comments Wed, 03 Nov 2010 10:24:22 +0000 xpj http://www.xpj.cz/expee/?p=55 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>
]]>
http://www.xpj.cz/expee/2010/11/compressing-content-using-a-servlet-filter/feed/ 0