Can anyone tell me the difference between using mod_deflate and zlib output_compression?
谁能告诉我使用mod_deflate和zlib output_compression之间的区别?
I understand that zlib is done in PHP and mod_deflate is done in Apace, my .htaccess file looks like:
我知道zlib是用PHP完成的,而mod_deflate是在Apace中完成的,我的.htaccess文件看起来像:
php_flag zlib.output_compression On
or:
要么:
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?
两者的优缺点是什么?
1 个解决方案
#1
9
As far as I know they both compress the same amount as zlib.output_compression uses gzip, which is based on DEFLATE.
据我所知,他们都压缩了与zlib相同的数量.output_compression使用gzip,它基于DEFLATE。
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).
PHP的zlib output_compression只能处理通过PHP处理程序传递的文件(即.php文件),但Apache的mod_deflate可以处理任何文件(例如静态CSS或JS)。
#1
9
As far as I know they both compress the same amount as zlib.output_compression uses gzip, which is based on DEFLATE.
据我所知,他们都压缩了与zlib相同的数量.output_compression使用gzip,它基于DEFLATE。
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).
PHP的zlib output_compression只能处理通过PHP处理程序传递的文件(即.php文件),但Apache的mod_deflate可以处理任何文件(例如静态CSS或JS)。