请求完成后,Laravel重定向需要很长时间

I need to handle a csv file with more than 10K lines. It represents a list of product and the goal is to update the products table in the database.

My problem is that the global workflow takes about 15 minutes, but telescope display a duration time of only 15Kms (about 2,5 minute).

So my question is : why could a redirect takes 13 minutes after the end of the request ?

This problem is showing up on local development environment using php artisan serve but also on a dev-online environment (VPS). It does not seems to be due to serve command then.

I've dumped each steps of the controller method and I confirm what Telescope says : the controller ends at 2,5 minutes. So after that, it does nothing except waiting.

The redirect action is handled like so at the end of controller :

return back()->withErrors($errorKey, $errorMessage);

I'd like to wipe out this redirect time and I can't find why this is happening.

Thanks for any help !

I'd check the server load... You've just rammed 10K rows against a database in two and a half minutes. 13 minutes does seem a bit high but try again and then try and redirect away from that route... Does it do the same thing? If so, it's most likely the load on the server.