Server push applications using FastCGI

Ron Newman (rnewman@nfic.com)
Fri, 26 Jul 1996 14:50:15 -0400 (EDT)

From: Ron Newman <rnewman@nfic.com>
Date: Fri, 26 Jul 1996 14:50:15 -0400 (EDT)
Message-Id: <199607261850.OAA09047@janis-joplin.nfic.com>
To: mbrown@OpenMarket.com
In-Reply-To: Mark Brown's message of Thu, 25 Jul 1996 18:53:11 -0400 <199607252253.SAA25484@breckenridge.openmarket.com>
Subject: Server push applications using FastCGI


I asked whether a FastCGI program can intermittendly stream output
to the client, based on a possibly false impression that a CGI program
can do so only if written as a non-parse-header (NPH) program.  
Mark Brown replied:

    A Web server that implements FastCGI sends application data to the
    client as long as there is any data to send; the data doesn't linger
    indefinitely in the server's buffer.  (Actually, the spec is silent on
    the issue, because I didn't realize it *was* an issue.  The Open
    Market server treats NPH and non-NPH CGI scripts the same with respect
    to buffering.  As a result of your query the spec will improve;
    thanks!)

I based my question on statements in the book "Build a Web Site"
by net.Genesis, pages 348-351.  This give an example of an
NPH server-push script, and claims:
  
   "The obvious question is why this has to be an NPH script 
    in order to work.  With regular CGI scripts, the server waits
    patiently until the CGi program has completed its processing.
    Then once it has received all output from the CGI program,
    it sends a response to the client.  But our sample program
    is supposed to send each one of the parts every ten seconds.
    Without an NPH script, the server would not send any of 
    the parts to the client until it had received all the parts
    from the program.  The server would then take the entire
    response and send it to the client, which would completely
    ruin the functionality of the program."

The CGI spec itself seems to be silent on this issue.