First of all, we first understand the relevant information of Apache Gzip.
First, Gzip introduction
Gzip is a popular file compression algorithm, now widely used, especially in the Linux platform. When you apply gzip compression to a plain text
This article describes how to compress pages to save website bandwidth and increase user access speeds.
The website access speed is determined by multiple factors, such as the application response speed, network bandwidth, server performance, and
Gzip compression actually compresses webpage content to reduce htmlCodeThe cost of network transmission to improve web performance.
The request process is explained.:
1: client request. Http_header will send the corresponding encoding rules
Response. Filter attribute: Modify the HTTP object data through the bound filter before the data is sent.
Application scenarios (gzip compression of website content, multi-language implementation, etc ...)
Definition: Public stream filter {Get;
For most HTTP requests, if we can get them to provide these resources in the form of compressed files, they can also be enormously efficient. All we need to do is turn on gzip, and then we can reduce the amount of network time it takes to download
Website access optimization (2): Enable gzip compression and apachegzip on the apache serverYesterday, the bandwidth was upgraded from 1 Mbps to 2 Mbps. After using the cdn jquery version, the Website access speed was increased from 5 s on average
yesterday, the bandwidth was upgraded from 1M to 2M, and after using the CDN version of jquery, the website was accessed by an average of 5s (in the case of disallowed caching, using the cache around 2.8s) down to 2.8s. today, continue to optimize. 1
The key to achieving custom output is to encapsulate httpservletresponse, intercept all outputs, and wait until the filter chain completes processing,Filter. dofilter: captures the output for processing and writes it to the real httpservletresponse.
Document directory
Feedback
When the page file is large, enabling gzip compression can reduce the transmission traffic. The test results are very obvious. Some people in the garden use the gzip compression function of IIS, this function has also
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.