atticus Posted February 15, 2008 Share Posted February 15, 2008 Hi all, I am using shared hosting and I do not have access to the server and I am trying to use php to gzip my components. I know my server is ablt to gzip because I have a version of zen-cart installed on it and it gzips the components. Its just not working. <?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?> Link to comment https://forums.phpfreaks.com/topic/91256-gzip-compression/ Share on other sites More sharing options...
Daniel0 Posted February 15, 2008 Share Posted February 15, 2008 I believe the ob_gzhandler() callback function takes care of checking whether the user agent is capable of handling gzipped content. Link to comment https://forums.phpfreaks.com/topic/91256-gzip-compression/#findComment-467662 Share on other sites More sharing options...
rhodesa Posted February 15, 2008 Share Posted February 15, 2008 I use this function all the time to send contents compressed, hope it works for you too: update: my posts aren't going through properly Link to comment https://forums.phpfreaks.com/topic/91256-gzip-compression/#findComment-467667 Share on other sites More sharing options...
rhodesa Posted February 15, 2008 Share Posted February 15, 2008 It won't let me post the code for some reason...so here it is in an attachment Link to comment https://forums.phpfreaks.com/topic/91256-gzip-compression/#findComment-467670 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.