Ob_gzhandler vs. nginx gzip

I currently compress my PHP with ob_gzhandler.

I’m going to add gzip to the nginx.conf to compress CSS and Javascript
but wondered if I should just let nginx compress the PHP output as well.

Any pros or cons either way?

On 8/2/08, Ian M. Evans [email protected] wrote:

I currently compress my PHP with ob_gzhandler.

I’m going to add gzip to the nginx.conf to compress CSS and Javascript but
wondered if I should just let nginx compress the PHP output as well.

Any pros or cons either way?

Eh, if you do it on the nginx level, you don’t need to mess with PHP
code. You can also just throw a blanket down of all the text-based
outputs to gzip (css, php output, etc) - you’re probably doing that
already for CSS/javascript, so why not? nginx does gzip really fast -
like, amazingly fast.

I had some issues with some clients not liking the PHP gzip stuff. I
tried ob_gzhandler, I tried a couple other things like manually
sending the gzipped content out, etc. I wound up having to add a flag
for specific users to not gzip their content.

Anyway, nobody’s complained yet on nginx. I’m sure if there was any
issue with PHP+gzip I was having is fixed now anyway.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs