Joomla!
http://forum.joomla.org/

Ob_start() and Apache TimeOut
http://forum.joomla.org/viewtopic.php?f=126&t=99754
Page 1 of 1

Author:  rovisoft [ Sat Sep 30, 2006 5:50 pm ]
Post subject:  Ob_start() and Apache TimeOut

Hi there all! I would like to present you here with an issue i have found in Joomla's core!

We all know that index.php and administrator/index2.php output the content through the ob_start() and ob_get_contents() functions, the Buffer functions!

Now, we all know that apache has a variable called Timeout and is used to stop scripts as expired if they send no content to the server!

Second, lets presume we have a function in a component that needs to run more that the TimeOut limit!

What happens is this:

  - since all the function output, if any, is caught by the buffer functions, the server won't get any data back except for the headers, which means that after that period, the server will stop the script from running giving back the client a timeout

What would be a solution for this:

- what i have tested is that i put a simple space (echo " ") just before the ob_start() function, this way the server gets some data and it won't stop the script from running

  Ideal would be if we could use instead of the space, the first tag from the html page "" or something related so we send to the server some data and to keep the rest of the process running!

  Please note that this procedure is tested, it's not a presumption!

  Looking fordward to your opinions!

Ovidiu

Author:  rovisoft [ Sat Sep 30, 2006 7:50 pm ]
Post subject:  Re: Ob_start() and Apache TimeOut

  One small problem:

  In the current state of Joomla the only problem with doing this would be if other components or modules would try to send any headers, so a solution for the future versions would be maybe to make a special class to call the headers of the extensions before the ob_start()

  Hope it helps! Ovidiu

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/