2

When I use Akeeba Kickstart it recommends that output buffering is disabled. Why does it recommend this? All my research shows that it can speed up sites.

It seems I'm not the only one asking https://forum.joomla.org/viewtopic.php?t=957942

I found some information here: What is an efficient way to troubleshoot a "white screen of death"

1 Answer 1

1

It seems you're not alone in searching for the answer to this question, and anybody who knows seems to have been guarding that knowledge carefully! 🤣 Nearest I've found is the following quote from the page linked below:

Actually, Joomla! always uses output buffering, except when it only needs to issue a redirection. Therefore you should turn it off so as not to have any conflicts with Joomla!.

https://www.akeeba.com/support/akeeba-backup-3x/11769-output-buffering.html

Now, what I THINK he is implying with that statement is that BECAUSE Joomla! explicitly uses output buffering whenever rendering a page (which it does in order to render the page content before wrapping it in a flexibly selected page template, allowing plugins to manipulate the resulting page before delivery, and potentially other reasons also), having the setting on in the PHP configuration options results in an unnecessary (but harmless) nested buffering operation.

That is, with the PHP output_buffering directive enabled, PHP will automatically commence buffering output before the Joomla script begins execution, then Joomla itself invokes ob_start() explicitly, resulting in a second output buffer being established. With the PHP output_buffering directive disabled, any output generated by the script is ordinarily dispatched immediately, but Joomla explicitly commences output buffering anyway, so the resulting content is buffered and delivered in the same way, but without the nominal overhead of the pointless additional buffering step.

To be clear, setting the output_buffering directive to 'Off' does not prevent output buffering from being used - it just means you need to call ob_start() and related functions to do so.

Disclaimer - I am reading between the lines here, and could be way off the mark. In any case, it seems not to matter a lick whether you have it on or off by default. I have used Joomla since v1.5 and never had a problem with the setting being on. 🤷

3
  • At least you have a theory. But if it buffered twice that could be a speed issue so I guess that's a good theory.
    – Eoin
    Commented Jun 21, 2023 at 10:33
  • 1
    Incidentally, after exploring this, i switched off output buffering on my server and immediately stumbled upon a problem with Joomla giving errors when debugging was enabled! Have not explored the reasons behind that at this point - I just switched it back on and got on with my life.
    – John Rix
    Commented Jun 21, 2023 at 15:05
  • No way I had that problem just the other day. But I was totally unaware that output_buffering could cause it.
    – Eoin
    Commented Jun 22, 2023 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.