views:

27

answers:

2

I have no idea of what compressor modules like gzip are, I have never used it so far, but it sounds like it can improve the site performance a lot, so I want to know What are compressor modules? Why are they important? and, How to use it? In terms for PHP.

+1  A: 

They, umm, compress stuff... :)

Websites can send pages to clients that are compressed (eg, gzipped) so that the time of transmission is lower, particular for low bandwidth clients (or servers with high loads, small pipes).

It can decrease the load time of a website, given sufficient transmission time savings vs decompression time costs.

For example, you can instruct PHP to gzip all pages with the following:

<?php
    ob_start("ob_gzhandler");
?>

Check out the manual page for ob_gzhandler.

Want the short of it in a SO-liked bullet point list? YW

  • What: They compress data, like the webpage your sending to the client
  • Why: Reduce the amount of data needed for transmission, which is often the biggest bottleneck.
  • How. Check out the PHP manual on ob_gzhandler for a starting point.
Dan McGrath
+1, so my `What are compressor Modules? and Why.....` are Answered. What about the remaining
Starx
A: 

You can improve your web site's performance by compressing HTTP responses:

JohnB
However, it may cost you web server CPU.
JohnB
And if your grandmother is running a 486-DX2 with broadband (and a gzip supporting browser) it might not like the decompression work ;)
Dan McGrath