Answer the question
In order to leave comments, you need to log in
How to make the php code first respond, and only then make any requests and calculations?
There is a small script that accesses vk api using file_get_contents. And there is a cron that calls this script every 30 minutes. The response of this script to cron is completely unimportant, in fact there are none at all. However, often, requests to vk api take too long and a timeout occurs. How can I first answer the cron that the page is loaded, and only then request the vk api and do all sorts of calculations?
Answer the question
In order to leave comments, you need to log in
php.net/manual/ru/function.fastcgi-finish-request.php
Just be careful, keepalive backend-frontend will break.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question