Tomcat Compression Does Not Add a Content-Encoding: gzip in the Header?

Have a look at sourceforge.net/projects/pjl-comp-filter/. Other custom solutions may have memory leaks. Also, if you are using mod_jk then you are certainly not using the 8080 connector (which supports compression) for those requests.

Cherouvim: Thanks. I will take a look. – Julien Chastang Mar 4 '09 at 18:53.

Tomcat will be doing the compression. However because you are using mod_jk I guess you are getting you requests via Apache on port 80 rather than tomcat on port 8080. As an experiment try getting your page via port 8080 and then checking yslow you should see the correct headers.

I think what is happening is that apache is unzipping the content that it is getting from tomcat via mod_jk and then passing the deflated content on to the browser. If you wish to use mod_jk then you will need to set up your compression on Apache rather than Tomcat. Good luck.

1 AJP is a binary protocol anyway, so compression won't work on the AJP Connector. En.wikipedia. Org/wiki/Apache_JServ_Protocol I wouldn't recommend using the HTTP connector on a high-load production server anyway, regardless of compression being on/off.

– opyate Mar 26 '10 at 10:45.

It's a stab in the dark, but it might relate to white-space compression, or line trimming. I would imagine Tomcat would be a bit more explicit in this regard (here's hoping). We have the gzip filter mentioned by duffmo running in our application, the web.

Xml looks something like this: App-Web GZIPFilter weblogicx.servlet.gzip.filter. GZIPFilter snip.

1 No, enabling compression in tomcat means gzip - it works fine for us under tomcat 6.0.20, though we do not have apache in front of our tomcat – nos May 27 '10 at 23:31.

I had a look at the Tomcat documentation here: tomcat.apache.org/tomcat-5.5-doc/config/... It mentions using compression="force" which worked for me. It also says you can set a minimum number. This worked fine for me (compress anything over 256Kb) The default value for compressableMimeType meant that I didn't need that attribute.

Also note that it doesn't list CompressionMinSize attribute.

To improve overall client side performance of J2EE web application, you can try WebUtilities java library. Here is the link :: code.google.com/p/webutilities/. It provides filter, tag, servlet components to apply various client side performance practices resulting in higher performance rating against PageSpeed/YSlow.

Since version 0.0.4 it helps with following performance practices. Minimize HTTP requests - can serve multiple JS/CSS files in one request Client Side Caching - adds proper Cache-Control, Expires header On the fly JS/CSS minification - using YUICompressor Compression - supports 2way compression for gzip/deflate/compress encodings Response Caching at Server - to avoid reprocessing of unchanged resources Add Character Encoding - to let browser know in advance It is also highly configurable/customization against MIME, URL or User-Agents.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions