Re: HTTP/1.1 pconns to 1.0 servers

Mark Nottingham schrieb:
>
> HTTP/1.0 persistent connections are documented in RFC2068. One case 
> that's not explicitly covered is when a HTTP/1.1 client sends a 
> request to a HTTP/1.0 server without a Connection: keep-alive header.
>
> My reading of 2068, 2616 and 2145 is that the fact that the client 
> indicates HTTP/1.1 in the request advertises their support for 
> persistent connections, and a HTTP/1.0 server (whether origin or 
> proxy) may safely use a Content-Length delimited persistent response.
>
> In my testing, two popular clients that advertise themselves as 
> HTTP/1.1 devices without sending a Connection token -- curl and 
> Apple's Safari -- handle persistent connections from HTTP/1.0 servers 
> very well.
>
> However, the widely deployed Squid proxy cache 
> <http://www.squid-cache.org/> does not behave in this manner; it 
> requires a Connection: keep-alive header (or Proxy-Connection, but 
> that's another discussion) in requests in order for them to persist.
>
I struggled with exactly the same issue when implementing a HTTP stack. 
Someone forced me with money to make it work with squid as it is widely 
deployed. Those were the days...

If you ask for intent, I think at the time of writing RFC 2068, HTTP/1.1 
clients could not assume that 1.0 servers derive persistent connections 
from the 1.1 version number alone, since server implementation might 
precede protocol definition.

If you ask for the best way to fix it, heroically lifting squid to 1.1 
seems like the best technical solution.

A patch might be much more easier and achieve world domination much more 
quickly. But still HTTP stacks like mine would need to inter operate 
with unpatched squids (and other servers, I continue to be amazed what 
beasts lurk in corporate <strike>closets</strike> intranets).

Cheers,

Stefan

Received on Thursday, 21 September 2006 07:21:38 UTC