JavaFAQ Home » Java Installation, tunning, options...
Improve page loading time on Tomcat server.
If you use Tomcat server to serve remote clients over the Internet you can significantly improve page loading time by enabling content compression. A content become compressed when it transports over the Internet. All modern browsers support HTTP/1.1 GZIP compression and if your server also enables it, the page load time decreases dramatically. They just popping out in a browser, like if they were served from a local server.
Enable compression In Tomcat for certain file types
Enable compression by adding compression="on" or compression="force". Please notice that MIME type of content type to be compressed is defined in compressableMimeType variable. Those variables are optional for Tomcat Connector and are defined in server.xml file. This file is the part of Tomcat configuration files and situated in conf directory under Tomcat home directory.
Two more useful parameters are, example:
Skip compression for small files in Tomcat
Compression minimal size is good to skip compressing too small files - the compression overhead will take away all benefits and can result in even bigger file
Look at the next example below:
<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="5" maxSpareThreads="25"
acceptCount="100" scheme="https" secure="true"
Printer Friendly Page
Send to a Friend
Search here again if you need more info!