Re: Keep-Alive Notes

"Roy T. Fielding" <fielding@avron.ICS.UCI.EDU> wrote:
  > [summarized current state of keep-alive for HTTP/1.1]
  > [...]
  >    Keep-Alive  = "Keep-Alive" ":" 1#( token ["=" word ] )
  > 
  > The presence of the Keep-Alive keyword in a Connection header signals
  > that the sender wishes to maintain a persistent connection.  The presence
  > of a Keep-Alive header field defines parameters for the persistence.
Is the Keep-Alive header mandatory or optional?  That is, is the presence
of just
	Connection: Keep-Alive
sufficient?
  > 
  > So, the client can send 
  > 
  >    Connection: keep-alive
  > 
  > to indicate that it desires a multiple-request session, and 
  > the server responds with
  > 
  >    Connection: keep-alive
  >    Keep-Alive: max=20, timeout=10
  > 
  > to indicate that the session is being kept alive for a maximum of
  > 20 requests and a per-request timeout of 10 seconds.  The Connection header
  > with keep-alive keyword must be sent on all requests and responses that
  > wish to continue the persistence.  The client sends requests as normal
  > and the server responds as normal, except that all messages containing
  > an entity body must have an accurate content-length (or, if HTTP/1.1 is
  > used by the recipient, a chunked transfer encoding). 
  > [... further discussion about Keep-Alive header ...]

I would argue that "max" and "timeout", at least serve no useful purpose.
Here's why.

Take "max" first.  The client must check for Connection: keep-alive in
each response anyway, before sending the next (at least currently)
serial request.  So "max" conveys no useful information.  If we're
anticipating pipelined requests, let's wait for then, rather than
clutter the HTTP/1.1 spec.

Now for "timeout".  Because of propagation and roundtrip delays, the
meaning of any particular value of "timeout" as received by the client
is suspect.  Suppose the value is "10" (seconds).  The client surely
has less than ten seconds to issue a new request.  But how much time is
there?  Does the client know the current round-trip time, so it knows
how much less time there is?  Does it know how long the server will
take to get to the request (during which time the timer may be
ticking)?  I think the answer is "No".

I argue, therefore, that the Keep-Alive header conveys no useful
information and ought to be dropped.

Dave Kristol

Received on Thursday, 12 October 1995 07:11:49 UTC