ob_gzhandler vs. nginx gzip

mike mike503 at gmail.com
Sun Aug 3 09:43:00 MSD 2008

On 8/2/08, Ian M. Evans <ianevans at digitalhit.com> 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.

More information about the nginx mailing list