Results 1 to 3 of 3
  1. #1
    casino2k.com's Avatar
    casino2k.com is offline Private Member
    Join Date
    January 2008
    Location
    Milano
    Posts
    343
    Thanks
    141
    Thanked 64 Times in 49 Posts

    Default Enabling gzip compression

    A very small tutorial to enable gzip compression to meet Google requirements about page load speed (original thread here)

    JOOMLA CMS
    If you are using Joomla cms, enable gzip compression from the administration control panel:
    SITE -> CONFIGURATION -> SERVER

    I suggest also enabling the "system - cache" plugin. Make sure to put it after the "system - sef" plugin.


    APACHE + PHP
    If you are using apache webserver (with mod_gzip enabled) and php, here is the script to gzip your pages.

    At the very top (before <html>) of the pages you want to compress (php OR html) put this code:
    PHP Code:
    <?php
    ob_start
    ("ob_gzhandler");
    ?>
    If your file has .php extension you're done.

    If you are using .html or .htm instead of .php you need to put this line in your .htaccess file:
    Code:
    AddType application/x-httpd-php .html .htm
    Hope it helps.

    References:
    http://php.net/manual/en/function.ob-gzhandler.php
    http://www.webcodingtech.com/php/gzip-compression.php
    Last edited by casino2k.com; 14 December 2009 at 9:56 am.
    Matteo » Casino2K

  2. The Following 3 Users Say Thank You to casino2k.com For This Useful Post:

    arisoftnet (14 December 2009), Bonus Paradise (18 December 2009), Chips (14 December 2009)

  3. #2
    arisoftnet's Avatar
    arisoftnet is offline Private Member
    Join Date
    September 2009
    Location
    Cyprus
    Posts
    232
    Blog Entries
    1
    Thanks
    16
    Thanked 26 Times in 17 Posts

    Default

    Thanks man .. works PERFECT!!!!

  4. #3
    shortow is offline Private Member
    Join Date
    December 1969
    Posts
    185
    Thanks
    15
    Thanked 34 Times in 25 Posts

    Default

    Worth checking this with your host. Both the php code and .htaccess parsing instructions may vary depending on who you're with.

    eg. at Godaddy:

    <?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?>

    and to parse in .html/.htm pages add the follwing to .htaccess...

    AddType application/x-httpd-php .htm .html
    AddHandler x-httpd-php .htm .html

  5. The Following User Says Thank You to shortow For This Useful Post:

    Chips (14 December 2009)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •