Welcome Guest, Not a member yet? Register   Sign In
GZip handling
#1

[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();
this will enable gzip on the OB only if the browser support gzip. Else it will start a normal uncompressed OB.


Apache itself will check the browser for gzip support and if it's not supported:
Code:
ob_start('ob_gzhandler');
will return false.

This will emprove perfomance for compressed pages. Smile

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
#2

[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
#3

[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.
#4

[eluser]InsiteFX[/eluser]
You can extend the Output Class and add your code to it.

application/core/MY_Output.php

InsiteFX
#5

[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...
#6

[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
#7

[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 =)




Theme © iAndrew 2016 - Forum software by © MyBB