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