in reply to Perl/CGI scripts
An alternate if you have some long processing that can continue without any further feedback to the user after sending "Thanks for your submission" is to fork a process to the long processing and close all of the STDIO handles in that process - in that way the main process will end and the server close the connection to the browser but you can continue processing:
Of course if you are getting a lot of hits and your processing is taking a very long time, you may will find yourself getting complaints from the administrator of the server.#!/usr/bin/perl -w + use CGI qw(:standard); + local $| = 1; + print header("text/plain"), "this is a test"; + if (!fork ) { close STDOUT; close STDIN; close STDERR; + # some long running processing ... for ( 1 ... 1000 ) { sleep 1; } }
/J\
|
|---|