In general, after the paging file opens gzip compression, its volume can be reduced 60%~90%, for the text class site, can save a lot of bandwidth and user waiting time. However, both IIS and Apache only compress the HTML class static files by default, for PHP files need module configuration to support (iis7.5 in dynamic + static compression can also), so the use of PHP's own functions to achieve the effect of gzip has become a reasonable demand.
Online tutorial Basically you copy me to copy him, just add the head plus tail or two kinds of self-configuration function. Actually every PHP page is going to add code-and of course it can include references, but it's always a little cumbersome.
In fact the simplest way, open the PHP directory under the php.ini file, find zlib.output_compression = Off, change to zlib.output_compression = ON,
To Zlib.output_compression_level in front of, remove, and change the value of 1 in the back. This will enable the gzip effect of all PHP pages, no longer need to modify the site's PHP files separately-if the site is many, it will save a lot of time.
The following points need to be explained
The Zlib.output_handler must remain commented out, as this parameter conflicts with the previous setting-the official argument.
Second, in general, the cache is 4k (output_buffering = 4096).
Third, Zlib.output_compression_level recommended parameter value is 1~5,6 to the actual compression effect is not increased, CPU consumption is geometric growth.
Figure 1: Viewing the request header and the response header via Firebug, in effect the gzip effect has been shown
Figure 2. Webmaster Station gzip Detection Tool also shows that gzip is valid.
http://www.bkjia.com/PHPjc/326646.html www.bkjia.com true http://www.bkjia.com/PHPjc/326646.html techarticle in general, after the paging file opens gzip compression, its volume can be reduced 60%~90%, for the text class site, can save a lot of bandwidth and user waiting time. But whether it's IIS or ...