PHP ob_start() and ob_start('ob_gzhandler')

Sithu picture Sithu · May 16, 2012 · Viewed 14.2k times · Source

What is the difference between using ob_start() and ob_start('ob_gzhandler') ?
How does it affect the page speed ?

Answer

Repox picture Repox · May 16, 2012

This doesn't affect page speed in the sense you'd might think.

the ob_gzhandler is a callback function which takes the contents from your output buffer and compresses the data before outputting it.

This reduces the size of the content being sent to the browser which might speed up the content transfer to the client. But it doesn't speed up your application/website.