mod_deflate模块之间的区别和zlib output_com pression模块、区别、mod_deflate、pression

2023-09-02 09:40:39 作者:我不吃藕

谁能告诉我使用mod_deflate模块之间和zlib output_com pression?

Can anyone tell me the difference between using mod_deflate and zlib output_compression?

据我所知,zlib的工作是在PHP和mod_deflate模块是宇瞻做的,我的.htaccess文件如下:

I understand that zlib is done in PHP and mod_deflate is done in Apace, my .htaccess file looks like:

php_flag zlib.output_compression On

SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSI[E] !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI 
.(?:gif|jpe?g|png|gif)$ no-gzip dont-vary
Header append Vary User-Agent env=!dont-vary

优点/任的缺点是什么?

Advantages/disadvantages of either?

推荐答案

据我所知,他们都COM preSS作为zlib.output_com pression使用gzip压缩同量,这​​是基于DEFLATE。

As far as I know they both compress the same amount as zlib.output_compression uses gzip, which is based on DEFLATE.

PHP的zlib的output_com pression将只通过PHP处理程序(即.php文件)通过的文件,但Apache的mod_deflate模块可以在任何文件的工作(如静态CSS和JS)。

PHP's zlib output_compression will only work files passed through the PHP handler (i.e. .php files), but Apache's mod_deflate can work on any files (eg static CSS or JS).