I'm about to launch a website and I'm going over my php.ini to prepare all the settings for a production environment.
I'm debating whether to leave output_buffering On, Off, or set it to a buffer limit (like 4096). Is there any pro's or con's to having the output_buffer turned On or Off? I've read that turning the buffer Off will give you some extra performance, but is there anything I should know before making my decision?
Why leave it off?
Why leave it on?
Why leave it on with a buffer limit?
The most common usage of output buffering is actually to allow your scripts to begin "writing" page content via print/echo/etc. yet still allow header() calls later in the script to work properly (since headers can only be sent before any actual page content is). If your scripts make use of such, then you'll need to leave output buffering on in order for your scripts to continue functioning with all header() calls behaving properly. (Otherwise you'll get the wonderful "header(): Warning, could not modify header information, headers already sent" message.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With