Compress PHP Website With GZIP

By | August 6, 2013
gzip website

gzip website

Compress Website with GZIP

I was checking some websites yesterday and i saw they took too much time to load. And i have to wait till website opens and it was just horrible. So i thought why people dont use the gzip which will help them to make their website perform faster. So here i am giving a simple script which will help you to make your php page gzip.

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

You can use the above code and check your page at below link. Just enter the url

http://www.gidnetwork.com/tools/gzip-test.php

May be it will help you all. Thank You

~~~~~ Happy Coding ~~~~~

One thought on “Compress PHP Website With GZIP

  1. Pingback: Compress CSS Using PHP | GZIP CSS Using PHP

Leave a Reply

Your email address will not be published. Required fields are marked *