If you need to have the complete response sent within 60 seconds, the first thing I'd do were to stop using CGI.
If you have to just send something within 60 seconds, immediately print out some reply (let's assume 200 OK is good), and keep printing bogus headers until you have the response ready.
| [reply] [d/l] |
If you need to have the complete response sent within 60 seconds, the first thing I'd do were to stop using CGI.
CGI has nothing to do with that. It's my computations.
If you have to just send something within 60 seconds, immediately print out some reply (let's assume 200 OK is good), and keep printing bogus headers until you have the response ready.
This I think is what I probably need. Could you give me an example. Say, there is a loop where I do some computations.
How can I push something back to the client in every iteration?
What do you mean by printing bogus headers?
| [reply] |
Status: 200 OK
X-Bogus-Header: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
X-Bogus-Header: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
...
X-Bogus-Header: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: text/html
<html>
<body>
...
| [reply] [d/l] |
Based on no experience whatsoever, my suggestion would be to:
- Generate a unique url.
- Respond immediately with a screen notifying the user their file is being generated, with an estimate of the time it will take, and a refresh header that will connect to the unique url.
- Start a background process to create the file.
- When the refresh occurs, use the unique url to locate the file that you created and give the user a download link.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |