Can someone show a simple example on how to use fastcgi_finish_request()
function?
I googled but only found some general mention of it, some people say they use
I understand that basically I can call
fastcgi_finish_request();
and then continue executing PHP script.
Yes, that's all you have to do.
$obj = new controller();
echo $o->getResult();
fastcgi_finish_request();
do_facebook_thing();
To convince yourself it is working, do this:
echo "Test";
fastcgi_finish_request();
sleep(10);
If you remove the second line, then you will see that the browser has to wait 10 seconds.