in reply to Complete part of a cgi script before the rest

The simplest option is to fork off the process that takes a long time so it's a child of init, and then just complete the short part. See here for a way to do that.
  • Comment on Re: Complete part of a cgi script before the rest