anks Posted May 22, 2010 Share Posted May 22, 2010 Folks, I read somewhere that by putting the below code on top of index.php will speed up the site load. <?php ob_start ("ob_gzhandler"); header("Content-type: text/css; charset: UTF-8"); ?> As per them we can even put this code on CSS files, but how will CSS execute PHP? Thanks All!!! Quote Link to comment https://forums.phpfreaks.com/topic/202571-will-it-speed-up-the-site-load/ Share on other sites More sharing options...
Daniel0 Posted May 22, 2010 Share Posted May 22, 2010 Well, it will compress the output so there is less data to download. Quote Link to comment https://forums.phpfreaks.com/topic/202571-will-it-speed-up-the-site-load/#findComment-1061917 Share on other sites More sharing options...
anks Posted May 22, 2010 Author Share Posted May 22, 2010 Well, it will compress the output so there is less data to download. nice, but how can it be used for CSS files? Does CSS execute PHP? Quote Link to comment https://forums.phpfreaks.com/topic/202571-will-it-speed-up-the-site-load/#findComment-1061929 Share on other sites More sharing options...
Daniel0 Posted May 22, 2010 Share Posted May 22, 2010 No, it does not. You can configure your web server to compress the files instead of having PHP do it. If you use Apache you can use something like mod_deflate. Quote Link to comment https://forums.phpfreaks.com/topic/202571-will-it-speed-up-the-site-load/#findComment-1061930 Share on other sites More sharing options...
xcoderx Posted May 22, 2010 Share Posted May 22, 2010 something like mod_deflate. with php.ini or htaccess file? explain more please of its usage Quote Link to comment https://forums.phpfreaks.com/topic/202571-will-it-speed-up-the-site-load/#findComment-1061943 Share on other sites More sharing options...
Mchl Posted May 22, 2010 Share Posted May 22, 2010 http://httpd.apache.org/docs/2.0/mod/mod_deflate.html Quote Link to comment https://forums.phpfreaks.com/topic/202571-will-it-speed-up-the-site-load/#findComment-1061944 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.