We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Can I use fastcgi_finish_request() with Phalcon and how ?

I'd like to use fastcgi_finish_request() (link) to return content to a user but do some additional work befor the script finishes. Is there a way to do it in Phalcon and how?


If you want to do extra jobs after sending the output the better place would be after echoing the response:

echo $application->handle()->getContent();

// process extra work here

Thanks for response.

Can you tell me what is actually happening in the framework afer I echo a string in my controller? Is it documented somewhere?


The framework has finished its execution, with the output transfered to the CGI you can perform aditional tasks after that.