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.
csv-table:::header: , High Speed Connection, 56k Modem Throttle
:widths: 15, 10, 10
Without Compression, 1.936 secs, 13.025 secs With Compression, 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:
- Go to your Tomcat installation directory
- Then go to the sub-directory called conf
- Edit server.xml
- 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"/>
- Save server.xml
- Compression will be turned on next time Tomcat is started.
See also
- related discussion developer mailing list
- reference documentation on Tomcat configuration covering gzip compression
- `issue with gzipped HTTP traffic in Microsoft Internet Explorer 6.0 Service Pack 1 <http://support.microsoft.com/default.aspx?scid=kb;en-us;823386&Product=ie600>`_