zggz12
zggz12

Reputation: 133

Bash CGI with apache, force apache to finish sending data to browser, without waiting for script completion

I have a cgi script that runs perfectly on my mac server. It sends out varied outputs just like any cgi script should. My problem however, is that sometimes I need the cgi script to run a long task before quitting. The problem with this however is that the browser then has to wait the long time before it sees the output. Is there any way to say "this script is not sending any more output" to apache and have it send it out while still allowing the cgi to finish its tasks in the background?

a general outline of my code is:

Upvotes: 0

Views: 542

Answers (2)

user4421421
user4421421

Reputation: 11

I don't now what you want to get, but probably you need to disable deflate module. This module compressing page before send it to browser, so your script must be done. If disabled, then script's output will be printed dynamicly

Upvotes: 1

clyfish
clyfish

Reputation: 10460

Send the long task to a jobs queue.

echo "your long task" | at now

Upvotes: 0

Related Questions