note 25087 added to function.fpassthru
| From: | php-general at lists dot php dot net | Date: | Tue, 10 Sep 2002 10:17:46 +0000 |
| Subject: | note 25087 added to function.fpassthru | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-36436@lists.php.net to get a copy of this message | ||
Note that the above comment about the "Connection: close" header is incorrect: it does not
guarantee that the connection will be closed immediately after the transfer is complete. Instead, it
informs the client that it can no longer use the existing HTTP connection to perform other HTTP
requests on the same server, and that the client MUST close the connection as soon as it has
finished handling the current request.
If the client (for example an old HTTP proxy) is using HTTP/1.0, it may not recognize this header,
and could could the connection open; the web server should detect this and close the connection and
ignore any further request attempt on that connection.
HTTP/1.1 clients MUST honor this header and close their connection as soon as they detect the end of
the answer.
In any case, the web server will initiate a watchdog after script completion, and will force the
deconnection after about 15 to 30 seconds if the client does not honor this header.
The exact time to wait for the "socket closed by remote" event is configurable in the web
server.
It is generally smaller when the "Connection: close" header has been sent by the server,
than when no "Connection:close" has been sent (in which case the connection persists for
longer time, to let the client navigate on the server without enduring new connection costs in terms
of: connection delays, number of socket control blocks in final wait state, number of used ports).
Don't abuse "Connection: close" on your server for every hosted page: this creates
more incoming TCP connection attempts than necessary, and slows the navigation on your site. Use it
only if your script cannot generate explicit content length in the result header, as the client will
have difficulties to determine the end of the results.
If you want to save connection resources to your server, always send an Explicit
"Content-Length" header within your script, or use the "chunked"
transfer-encoding to explicitly send the result by delimited fragments (if the client is using
HTTP/1.1, it MUST support this chunked transfer encoding, per specification). See RFC2616 for
details.
--
http://www.php.net/manual/en/function.fpassthru.php
http://master.php.net/manage/user-notes.php?action=edit+25087
http://master.php.net/manage/user-notes.php?action=delete+25087
http://master.php.net/manage/user-notes.php?action=reject+25087