ngreenwood6 Posted November 16, 2009 Share Posted November 16, 2009 I have been looking into making my pages load faster. So I came across this article that said using gzip can help speed up page loads. I just cant seem to figure out how to get it to work. I have been reading all you have to do is add it to the header. Any help is appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/181796-headers/ Share on other sites More sharing options...
MadTechie Posted November 17, 2009 Share Posted November 17, 2009 A VERY basic idea would be to use ob_gzhandler like this, <?php ob_start("ob_gzhandler"); ?> <html> <body> <p>This should be a compressed page.</p> </html> <body> however now all browsers will accept (unzip it), so adding a check maybe an idea <?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/181796-headers/#findComment-958818 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.