I have a question regarding the use of Tomcat 6.0.14, and the interaction between the Tomcat built in compression, and custom filters. I am just using Tomcat - with no http server in front.
My problem is that when I enable my filter, the compression seems to be disabled. This is observed by examining the output from a Fiddler trace.
An example of the headers for the working scenario is:
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Cache-Control: no-cache Set-Cookie: rcounter=17 Pragma: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type: text/html;charset=UTF-8 Transfer-Encoding: chunked Content-Encoding: gzip Vary: Accept-Encoding Date: Wed, 29 Sep 2010 04:47:50 GMT
A non working scenario is:
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Cache-Control: no-cache Set-Cookie: rcounter=3 Pragma: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type: text/html;charset=UTF-8 Transfer-Encoding: chunked Date: Wed, 29 Sep 2010 04:44:49 GMT
The compression is defined using the server.xml configuration file:
<Connector port="8202" protocol="HTTP/1.1"
maxThreads="120" minSpareThreads="4"/>
connectionTimeout="20000"
compression="on"
compressionMinSize="2048"
compressableMimeType="text/html,text/plain,text/css,text/javascript"
redirectPort="8402" />
The filter is defined in the web.xml for the server (not the webapp).
I was wondering if anyone had experience with this, or suggestions on what to check.
cheers, Evan