/ home / customer care

Knowledgebase
You are here: Support > Knowledgebase > Programming

Reduce Bandwidth by using PHP Gzip

Most webpages are sending to users using an uncompressed form. Actually PHP includes functions for sending pages in a "gz-encoded" form which will reduce around 60% to 80% of your webpage. This means your page will load much faster and lots of bandwidth can be saved.

To enable Gzip, just add below lines at the start of your files. As simply as this:

<?php
ini_set('zlib.output_compression_level', 5);
ob_start("ob_gzhandler");
?>

Note: compression level can be defined from 1 to 9



Was this answer helpful?

Add to Favourites
Print this Article

Powered by WHMCompleteSolution


Language:
Valid XHTML 1.1 Valid CSS Powered by Apache Powered by MySQL Powered by PHP UTF8 Charset Minimium 800x600 Resolution