Load your PHP pages faster with GZip compression

If you have heavy pages with lots of images and text, you can greatly improve its' performance by dynamically compressing the page with php.

Put the below code in the header of each php page.

<? ob_start("ob_gzhandler"); ?>

It automatically gzips the page for browsers that support it.

This could also be set in the php.ini file instead, so all php pages are automatically compressed without having to add the above code in each and every php page.

In php.ini add the below code:

output_handler = ob_gzhandler

Comment