![]() |
GZip handling - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: GZip handling (/showthread.php?tid=40486) |
GZip handling - El Forum - 04-10-2011 [eluser]shadow player[/eluser] Hi I just checked out how CI handles gzip compression in the 'Output.php' core library. There's a better solution for enabling gZip compression or not, without having to mess with headers: Code: if(!ob_start('ob_gzhandler')) ob_start(); Apache itself will check the browser for gzip support and if it's not supported: Code: ob_start('ob_gzhandler'); This will emprove perfomance for compressed pages. ![]() It may also be a good idea to leave this enabled by default, I have used it in tons of PHP scripts and never have had any trouble. Best regards Tom GZip handling - El Forum - 04-10-2011 [eluser]InsiteFX[/eluser] ob_start will interfere with the Output Class! I had an ob_start at the beginning of one of my pages and it refused to display {elapsed_time} and {memory_usage} InsiteFX GZip handling - El Forum - 04-10-2011 [eluser]shadow player[/eluser] That's obvious... you can't start more than one OB. But the code I'm posting is ment for the Output Class to use, not for the user. GZip handling - El Forum - 04-10-2011 [eluser]InsiteFX[/eluser] You can extend the Output Class and add your code to it. application/core/MY_Output.php InsiteFX GZip handling - El Forum - 04-10-2011 [eluser]shadow player[/eluser] I'm not trying to implement it, I know that it works. I'm proposing this solution to be included in the code of a future version of CI... GZip handling - El Forum - 04-10-2011 [eluser]InsiteFX[/eluser] Then you need to add it on the Reactor User Voice or it will never even get looked at! CodeIgniter - Reactor User Voice InsiteFX GZip handling - El Forum - 04-10-2011 [eluser]shadow player[/eluser] [quote author="InsiteFX" date="1302473789"]Then you need to add it on the Reactor User Voice or it will never even get looked at! CodeIgniter - Reactor User Voice InsiteFX[/quote] Thank you very much =) |