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).
1 2 3 | if(extension_loaded("zlib") && (ini_get("output_handler") != "ob_gzhandler")) { add_action('wp', create_function('', '@ob_end_clean();@ini_set("zlib.output_compression", 1);')); } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.