http://otndnld.oracle.co.jp/document/products/wls/docs81/secmanage/domain.html
http://docs.oracle.com/cd/E16764_01/web.1111/b55548/filtering.htm
http://www.syboos.jp/java/doc/servlet-filter-implement.html
http://japan.internet.com/developer/20091020/26.html
一般に、サーバレスポンスに大量のテキスト出力あるいはバイナリ出力が含まれる場合は、圧縮してからネットワークに送出した方がパフォーマンス向上につながります。
データ量が少ないレスポンスの場合は、圧縮のメリットはあまり期待できません。サーバ側とクライアント側の双方で展開処理を行うため、そのぶんだけパフォーマンスが低下するからです。同様に、長距離間の通信ではない場合も、圧縮をすべきかどうかは慎重に検討した方がよいでしょう。展開処理の負荷によって圧縮のメリットがほとんど相殺されてしまうケースも考えられるからです。
http://www.thetechie.org/enabling-gzip-compression-with-servlet-filter/
http://sourceforge.net/projects/pjl-comp-filter/
<dependency> <groupId>net.sourceforge.pjl-comp-filter</groupId> <artifactId>pjl-comp-filter</artifactId> <version>1.7</version> </dependency>
<filter> <filter-name>CompressingFilter</filter-name> <filter-class>com.planetj.servlet.filter.compression.CompressingFilter</filter-class> <init-param> <param-name>includeContentTypes</param-name> <param-value>text/plain</param-value> </init-param> <init-param> <param-name>compressionThreshold</param-name> <param-value>0</param-value> </init-param> </filter> <filter-mapping> <filter-name>CompressingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
<filter> <filter-name>CompressingFilter</filter-name> <filter-class>com.planetj.servlet.filter.compression.CompressingFilter</filter-class> <init-param><param-name>includeContentTypes</param-name><param-value>text/html,text/css,application/x-javascript</param-value></init-param> <init-param><param-name>compressionThreshold</param-name><param-value>256</param-value></init-param> </filter> <filter-mapping> <filter-name>CompressingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
なにか参考になるかもしれないとおもうので、Tomcatの圧縮設定についてメモしておく
http://tomcat.apache.org/tomcat-5.5-doc/config/http.html
The Connector may use HTTP/1.1 GZIP compression in an attempt to save server bandwidth. The acceptable values for the parameter is "off" (disable compression), "on" (allow compression, which causes text data to be compressed), "force" (forces compression in all cases), or a numerical integer value (which is equivalent to "on", but specifies the minimum amount of data before the output is compressed). If the content-length is not known and compression is set to "on" or more aggressive, the output will also be compressed. If not specified, this attribute is set to "off".