I'm creating a web API whose job is to open and unpack several files (could be thousands depending on the search term). So far, I've got it working well. Using wget or curl to query the API ends up returning the information I want.
My issue is that large searches will timeout in a browser after a few minutes. In a previous incarnation of this, I was able to send garbage headers to the browser to tell it I was still working, but now we've moved to Flask and I'm unsure as to how I keep the browser from timing out.
I have looked at streaming data from Flask but there is no guarantee that any data will arrive by the time the browser closes.
At the moment, our clients would prefer just keeping the current page open instead of another solution like giving them a link to the location of where the data will be located once complete. That said, if there is no way to keep the current page open, I'd be interested in hearing other options.
Edit: In response to a comment below I thought it would be pertinent to know that this API would be very lightly used. Tying up resources is not a problem.