Answer
Do not hold the request open. Put the job on a queue and return 202 Accepted with a job id (and a status URL). The client polls the status, or gets a webhook or push when the job finishes.
API design · Flashcard
Do not hold the request open. Put the job on a queue and return 202 Accepted with a job id (and a status URL). The client polls the status, or gets a webhook or push when the job finishes.