File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes HTTP Response compression Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "HTTP Response compression" Watch "HTTP Response compression" New topic

HTTP Response compression

Nitin Dubey
Ranch Hand

Joined: Oct 30, 2000
Posts: 126


I am running APACHE - 228 with Tomcat 6.0.14.

Is there any method to compress responses sent through AJP connector? The default implementation of AJP connector does not seem to support compression as of now. I also need to ensure that all responses are compressed but NOT below a particular response size (say 200kb).

I have gone through the net and came up with following options:

1. Compress responses sent from AJP connector. (couldn't find anything, documentation for AJP connector does not mention compression anywhere)
2. Compress responses with Apache 228 modules.
3. Applying Servlet filters into the web application. (Can we identify if a response is to be compressed or not based on its size?


William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
A servlet side filter is the standard way of accomplishing this, and is certainly more efficient than transmitting the full bulk of the response through the AJP connector.

You will need an application that always sets content-length.

I agree. Here's the link:
subject: HTTP Response compression
It's not a secret anymore!