$php_mysql$ Posted August 27, 2011 Share Posted August 27, 2011 hey all now im new to gzip got not much knowledge on it. i was testing my site in seositecheckup and according to the test im asked to compress my html, css and js files and i found this bit of coding on google <?php if(isset($_SERVER['HTTP_ACCEPT_ENCODING']) && substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start('ob_gzhandler'); else ob_start(); ?> i included this file on top of my pages and then it seemed to compress my my file but it seem we need to set header expire on gzip so how could i set expire on it and could someone tell me what exactly is this coding above compressing i mean is it compressing image and all type of files? Quote Link to comment Share on other sites More sharing options...
gizmola Posted August 29, 2011 Share Posted August 29, 2011 There is no reason for you to be doing this in php code. Apache has a module (mod_deflate) that handles gzipping things on the fly. There are probably scores of howtos and docs on this, but here's a decent one: http://www.justinbritten.com/work/2008/12/apache-gzip-configuration/ You do not want to gzip images -- they already have compression in them. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.