Tomcat Compression

Speed up Tomcat HTTP requests by compressing HTML and XML content

Enabling Tomcat compression is a very effective way to speed up end-user mifos response times for users that do not have high bandwidth connections.

As an example, Jeff Brewster did the following one-off, informal mifos test.

gzip compression?

High Speed Connection

56k Modem Throttle

Yes

1.936 secs

13.025 secs

No

1.957 secs

4.203 secs

The actual mifos transaction took about two seconds to complete on the server in both cases. However, with compression on, the end user with the simulated 56k modem only had to wait an additional two seconds rather than eleven to receive their results.

How to Turn on Tomcat Compression

There is a link to the Tomcat documentation below. However, it is quite straight-forward, so here's the one minute version:

  1. Go to your Tomcat installation directory
  2. Then go to the sub-directory called conf
  3. Edit server.xml
  4. Go to the section that looks like this:
    <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>
    and change it to this:
    <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"
        compression="on" compressableMimeType="text/html,text/xml,text/plain,text/javascript,text/css"/>
  5. Save server.xml
  6. Compression will be turned on next time Tomcat is started.

See also