in reply to Print the output from the pipe while waiting
This may help: Watching long processes through CGI.