While I believe that WHB supports the Apache mod_gzip this is even an easier way to get the same exact bandwidth savings. And it is very portable to other web hosts who don't support this.
Just add this 1 line of PHP code to all of your .php pages:
<?php ob_start("ob_gzhandler"); ?>
on the VERY FIRST LINE of your code. It is very important this is the very first line of code in your pages or it will not work! IF your pages are html you can simply change them from .html to .php and add this line of code to gain the benefits without changing any other code in your pages. Besides saving your hosting account bandwidth it will make downloads of your web pages for dialup users much faster!
Here are some examples of the difference this 1 line of code made for some of my web pages.
My Webs home Page
Original Size: 11 KB
Gzipped Size: 4 KB
Data Savings: 63.64% <-- almost 1/3 of original
MOTAS Game Walkthrough
Original Size: 40 KB
Gzipped Size: 12 KB
Data Savings: 70% <-- A little better than 1/3 of original
List Of Curse Words this page is #1 in Google and gets Alot of hits so it will help out alot here. Warning don't go to the actuall web page that this link tested if easily offended. It is safe to click this link though to see the test results.
Original Size: 36 KB
Gzipped Size: 8 KB
Data Savings: 77.78% <-- less than 25% of original
And the best one of all.
PHP backend for AJAX scripts Warning don't go to the actuall web page that this link tested if easily offended. It is safe to click this link though to see the test results.
Original Size: 166 KB
Gzipped Size: 6 KB
Data Savings: 96.39%
WOW 3.61% of the original size![]()
These last 2 pages tested use alot of PHP & MySQL and some javascript / AJAX. So I think if this works on these pages without issues it should work on any page most likely. IF you use a common "Header" file that you include() in all pages like I do on one of my sites then just add the 1 line of code to that "Header" file and instantly your whole web site is GZipped.
You can read more details from the web page I found this on here:
GZip Test this page has a tool to check if a web page is using gzip or not. Either way it tells you how much bandwidth gzip is saving or would save if enabled.
This page explains GZip in more detail and lists the 1 line of code I mention. PHP GZip
Hopefully this will open other users eyes to how much of a difference gzip can make. It would seem on average you can expect a savings in the range of 50% - 70% but even much better is possible as I have shown. Both Google and Yahoo use this and since 99% of browsers support this there is no reason you shouldn't either. And if a browser doesn't support GZip then they get uncompressed data instead. WIN - WIN for both you and your customers!
Thank you,
MyWebs


LinkBack URL
About LinkBacks




Reply With Quote

