Tomcat compression Configuration

Source: Internet
Author: User
Tags tomcat

Problem Description: HPS Open login page (that is, user input user name and Password page), to load data and programs, about 2M size, in the case of bad network, to 10 seconds or even dozens of seconds, the company intranet test needs: 3 seconds more
Workaround:
1. Open the login page, the user entered the user name and password when loading other programs (that is, the 2M package);
Pros: Fundamentally address the corresponding time on the login page
There are difficulties: to adjust the interface of a lot of things, there is no energy, the impact of normal progress development, may also introduce bugs, follow-up and re-tune;
2. Modify the Tomcat configuration and compress the 2 m program (tested to approximate: 385K)
There is a problem: the loader problem cannot be fundamentally resolved
Advantages: Performance increased 1 time times, in the case of poor speed, the estimate will be more obvious;
Configuration method:
Add the following red font configuration in Tomcat's Server.xml

<connector port= "8180" protocol= "http/1.1"
               connectiontimeout= "20000"
               redirectport= "
               8443" Compression= "on"                <!--means open gzip compression
               --compressionminsize= "2048"       <!--means that packets larger than 2M are compressed   -- >
               nocompressionuseragents= "gozilla,traviata"
               compressablemimetype= "text/html,text/xml,text/ Javascript,application/x-javascript,application/javascript,text/css,text/plain "/>    

After adjustment:

Before adjustment:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.