Wednesday, August 18, 2010

How to Save bandwidth

To save bandwidth add the following code at the beginning of your PHP page, and then PHP will automatically compress the page to web browsers that support with feature (support in both Internet Explorer and Mozilla Firefox do).
Since HTML can easily be compressed, you can expect to cut down by at least 2/3 the bandwidth used at the expense of some extra load on the server's CPU, but the CPU load difference usually isn't even noticeable.

@ini_set('zlib.output_compression_level', 1);
@ob_start('ob_gzhandler');

No comments:

Post a Comment

I just got my #domain @BigRock. Get upto 25% off with my personalized coupon link Get upto 25% off