How to enable gzip compression on website pages?

Discussion in 'Google' started by smartamit04, Oct 25, 2010.

  1. #1
    Hi to all,
    I was checking my website performance in Google webmaster tool, They suggest me to enable gzip compression on some pages of my website. But i don't know how do it.

    Can any one suggest me steps to do this.
     
    smartamit04, Oct 25, 2010 IP
  2. prasanna724

    prasanna724 Peon

    Messages:
    126
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    sorry dude i cant help you
     
    prasanna724, Oct 26, 2010 IP
  3. gameutopia

    gameutopia Peon

    Messages:
    975
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    There are a number of ways. If your site is php based it is not too difficult. But it can depend on the script you are using too. Some are easy others can be more time consuming and difficult. Your host should also have gzip - deflate available on the server most do but not all. If they don't you are probably out of luck. Standard html pages usually don't work so well. You can change or rewrite them to php then add gzip compression. Simplest is to just add <?php ob_start ("ob_gzhandler"); ?> at the top of php pages. There are other methods though, and some other methods for .css, .js, etc.
     
    gameutopia, Oct 26, 2010 IP
  4. bogs

    bogs Active Member

    Messages:
    2,142
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    80
    #4
    bogs, Oct 27, 2010 IP
  5. estudientes

    estudientes Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Here it is;
    <?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?>
    Put it at the top. But your web server needs to support this code. For godaddy webhosting, it works.
     
    estudientes, Oct 27, 2010 IP