Optimizing the Apache Web compression
Article Directory
A, gzip Introduction
Two, Apache compression module
Third, the comparison module mod_deflate module mod_gzip
Four, page compression
V. Summary
A, gzip Introduction
Configuring Apache Web compression, after using gzip compression algorithm to compress web content, and then transferred to the client browser
effect:
Reduce the number of bytes transmitted over the network, speed up page load
Save traffic, improve the user's browsing experience
gzip and search engine crawlers have a better relationship
Two, Apache compression module
Apache web page compression to achieve functional modules include
mod_gzip module
mod_deflate module
Apache 1.x
No built-in web compression technology, but may use a third party to perform compression module mod_gzip
Apache 2.x
During development, built mod_deflate this module, replace mod_gzip
Third, the comparison module mod_deflate module mod_gzip
Both use gzip compression algorithm, similar to how it works
mod_deflate compression speed road fast, and slightly higher compression ratio mod_gzip
mod_gzip occupation of the server CPU to be higher
High-traffic server, using the mod the deflate may be higher than mod faster loading speed gzip
Four, page compression
1, mount the shared file and extract to / opt / directory.
Installation package optimization
2, install compilation tools
3, the configuration /opt/httpd-2.4.2
4、执行 make && make install
5, open the main Apache configuration file, see the module
Modify the port and domain name
Headers LoadModule Module modules / MOD headers. // SO enabled by default
Deflate the LoadModule Module1 modules / MOD deflate. // SO deflate module removed from the front opening #
Filter LoadModule Module modules / MOD filter. SO // enabled by default
Add at the end of file
Verify apache is set success
6, open the apache service, turn off the firewall, and open verification module
7, in the win10 system installation capture tool Fiddler, find the installation package directly online.
8, the packet capture tool Fiddler4, you can see allow gzip, but does not display the specified compressed content.
Refresh the page, insert the picture appears
Displayed in the capture tool transmission process gzip compression.
V. Summary
Configuring Apache Web compression, transmission to the client browser, reducing the number of bytes transmitted over the network, speed up page load.
Note: apache service turned remember: in / usr / local / httpd / bin / below ./apachectl strat