I'm trying to do the following in PHP...
echo "We'll email you as soon as this is done.";
// get the size of the output
$size = ob_get_length();
// send headers to tell the browser to close the connection
// Flush the buffer
// do some logging work etc.
...but it doesn't work. The "Connection: close" header is removed. There is a "Content-Length" header, but perhaps this is being ignored and replaced by Apache anyway.
Has anyone else been able to solve this?
My PHP mode is 5.3 FastCGI. Extra web security is enabled.[hr]
Sorry, just to clarify: I expect the page to appear quickly. Instead, it waits the full 5 seconds for sleep(5) to complete, before the page starts rendering.
I want to be able to let the client render the page, and keep the PHP going to do some logging etc.