[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-WebCGI] To .acgi or not to .acgi ??



> >According to MacPerl Power and Ease (p. 233): "Most Mac OS web servers
>>will wait for a CGI to finish running before responding to any other
>>requests... so a CGI can appear to slow down the entire server
>>significantly....you should always use the .acgi (Asynchronous CGI)
> >suffix for your CGIs."
>Boy, am I confused now. On one hand some people say DON'T use .acgi and on
>the other hand other people say TO use .acgi. Does anyone have a set of
>environments/conditions when it's Okay and when it's not Okay to use .acgi?
>
>tedd

1) See my previous message: this quote in MPP&E has been modified in 
an erratum.

2) My Perl Month column on MacPerl CGI programming has just appeared:

    http://www.perlmonth.com/columns/mac_perl/mac_perl.html?issue=11


    My column discusses this issue some, and a future column will go 
into more detail.

3) I think the .cgi behavior varies between different Mac Web 
servers.  For Quid Pro Quo, the above quote is incorrect.  I suspect, 
however, that the behavior described in MPP&E may be correct for the 
MacHTTP/WebSTAR lineage.

CONSIDER THIS A SECOND CALL FOR FEEDBACK!

Run a MacPerl CGI named with the .cgi suffix using your Mac Web 
server software.    Use a script that takes some time to execute. 
While the MacPerl CGI script is executing, using a different window, 
issue a request for a plain HTML page.  Quid Pro Quo will return it 
immediately.  WebSTAR may wait until the CGI has completed.  Post 
your results, including Brand and Version # of Web server, MacOS 
version , and any thing else that seems important.  An example script 
is appended.

4) I think it is now the consensus of the community:
    a. that one should be very cautious about using MacPerl CGIs on a production
       web server,
    b. given that you have decided to use a MacPerl CGI on a public web server,
       it is almost always better to use .cgi than .acgi.

-David-

#!perl
#
# slow.cgi
# Last Modified 04/11/2000
# by David Steffen, steffen@biomedcomp.com
#
# a simple, slowly executing Perl CGI script

print "HTTP/1.0 200 OK\015\012";
print "Server: WebSTAR/1.2\015\012";
print "MIME-Version: 1.0\015\012";
print "Content-type: text/html\015\012\015\012";

print <<HTML;
<html><head><title>slow.cgi</title><head><body>
<h1>Sleeping...</h1>
<p>This thread sleeps for 10 seconds before finishing...
HTML

sleep 10;

print <<HTML;
<p>...all done!</p>
</pre></body></html>
HTML

__END__
David Steffen, Ph.D.
President, Biomedical Computing, Inc. <http://www.biomedcomp.com/>
Phone: (713) 610-9770 FAX: (713) 610-9769 E-mail: steffen@biomedcomp.com

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org