开发者

Mod_gzip and php output bufferring redundant?

I'm just learning ways to compress my website and i came upon two methods. One of them is apache's mod_gzip module and the other is php's output buffering, since they both compress files, would using both methods be redundant and unne开发者_如何学Ccessary? Or is there a distinction between the two methods i should know about?


Yes, the two methods are redundant to one another. Between the two, mod_gzip is generally easier to set up and more comprehensive -- as it's part of Apache, mod_gzip can compress content (like static HTML, Javascript, and CSS) which isn't served through PHP.


Note: PHP's output buffering doesn't necessarily compress output. But yes, if you have it configured to do so, then it and mod_gzip/mod_deflate are redundant. In most cases, I prefer to leave the compression to Apache, since it will also compress things that aren't run through PHP, like JS, CSS, XML, text, etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜