3 ms·
Better options would be: 1. Send partial HTTP response (206) with progress details which may be handled using AJAX progress API at the client before sending fi
by anuraj 8y ago
Better options would be:
1. Send partial HTTP response (206) with progress details which may be handled using AJAX progress API at the client before sending final response. This is processing and network intensive but may be needed in certain scenarios like drawing graphics etc. You cannot recover from connection loss.
2. Handover the task to a job scheduler and return the jobid. Client can then poll jobid using a status API or get the status pushed using a webhook. This is the more optimal approach for majority of cases.
- wrs 8y ago#2 is essentially what the article describes.
- zbjornson 8y ago206 is only valid to respond to range requests, which can only be GET requests.
- geezerjay 8y agoAdditionally, the 206 suggestion fails to take into account basic use cases such as having more than one queued job.
- korijn 8y agoNumber 2 is super easy to implement with libraries like celery.
- geezerjay 8y ago> 2. Handover the task to a job scheduler and return the jobid. That's the approach described in the article. Where does your suggestion differ from it?