Problem
This problem has bothered me quite a long time. I'm dealing with a web API which provides the function that query the database by some specific conditions, fetch the qualified data back, and generate an .xls file for download.
However, the data amount is really really large, so generate the .xls file will relatively cost a long time. This may cause an HTTP Timeout. I used to created a generator to yield the records line by line formatted by .csv . It works well on the aspect of performance(I mean fast to generate and download), with some side effects, however. As I mentioned in the previous two questions:
How can I adapt my code to make it compatible to Microsoft Excel?
How can I send an xls file one line per time through http response?
Qeustions
After a serious consideration, I finally decide to generate the whole .xls file on the server side, and then provide for download. But how can I maintain the http connection during the time for generating the .xls file?
Aucun commentaire:
Enregistrer un commentaire