(1) The Web server processes HTTP compression as follows:
① After receiving the HTTP request from the browser, the Web server checks whether the browser supports HTTP compression.
(Accept-Encoding information );
② If the browser supports HTTP compression, the Web server checks the suffix of the request file;
③ If the requested file is a static file such as HTML and CSS, the Web server will check whether the latest compressed file of the requested file already exists in the compressed buffer directory;
④ If the compressed file of the request file does not exist, the Web server returns the uncompressed request file to the browser and stores the compressed file of the request file in the compressed buffer directory;
⑤ If the latest compressed file of the request file already exists, the compressed file of the request file is directly returned;
(2) Use of the Web server to process HTTP compression:
① Reduce I/O usage;
② Reduce bandwidth usage;
③ Optimized transmission speed;
(3) webpage setting rules
① Html, css, plain and other text files are compressed
② While mp3, jpg and other binary files do not need to be compressed, because the compression rate is low while wasting I/O
1. Page text compression module
LoadModule deflate_module modules/mod_deflate.soLoadModule mime_module modules/mod_mime.so
Deflate_module: Page compression module
Mime_module multimedia Module
MIME: multimedia type
HTTP: text/html
ASCII: text/plain
JPEG: image/jpeg
GIF: image/gif
QuickTime: video/quicktime
Check whether the dependency module is enabled
# Httpd-M | grep deflate
2. Edit the configuration file/etc/httpd24/httpd. conf.
3. Restart the httpd service.
# Service httpd24 restart
4. Test the webpage
This article from the "Wind thin pig" blog, please be sure to keep this source http://jungege.blog.51cto.com/4102814/1381357