Tuesday, 25 April 2017

How to make the client download a very large file that is genereted on the fly

I have an export function that read the entire database and create a .xls file with all the records. Then the file is sent to the client.

Of course, the time of export the full database requires a lot of time and the request will soon end in a timeout error.

What is the best solution to handle this case?

I heard something about making a queue with Redis for example but this will require two requests: one for generating the file and the second to download the generated file.

Is this possible with a single request from the client?



via Simoyw

No comments:

Post a Comment