WordPress Function to Enable GZIP output compression

Enable GZIP output compression

Normally the server should be set up to do this automatically, but a lot of shared hosts don
t do this (probably to increase client bandwidth usage)

 if(extension_loaded("zlib") && (ini_get("output_handler") != "ob_gzhandler"))
   add_action('wp', create_function('', '@ob_end_clean();@ini_set("zlib.output_compression", 1);'));

You may also like...

Leave a Reply

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