I have a products search page that loads data from several sources. For speed optimization, I had put ob_start() on top of the page and ob_end_flush() at the bottom so that all the output is buffered and then printed. But this makes the page load even slow. It adds around 0.3seconds to the actual page load time.
Any ideas why this would happen?
Why would you expect this to speed things up in the first place?!
Output buffering stops content from being sent to the client. It keeps everything back until you release it with ob_end_flush
. If you didn't buffer, content would be sent to the client immediately as soon as you start outputting it. Of course output buffering will delay sending of the content by definition.