本文介绍了mod_deflate模块之间的区别和zlib output_com pression的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我使用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).

这篇关于mod_deflate模块之间的区别和zlib output_com pression的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-24 23:08