Re: #158: Proxy-Connection and Keep-alive

On Tue, Nov 29, 2011 at 12:42:15AM +1300, Amos Jeffries wrote:
> We seem not to have any troubles nowdays emitting only Connection. The 
> problems are on satisfying the sources who send Proxy-Connection still. 
> IMO it would be nice to have a guideline to point at stating that 
> Connection overrides Proxy-Connection and the latter should be ignored 
> for processing and never emitted.

The issue for a client is that emitting nothing does not behave equally on
all proxies. Older Squid assume a close and newer 1.1 products will behave
with an implicit keep-alive. In theory sending "Connection: keep-alive" is
useless, except that in this case it can be the solution for those products.
Probably that the guideline should say that a client should explicitly send
"Connection: keep-alive" if it does not know whether the proxy is 1.1 or 1.0
and not use Proxy-Connection at all. I'm insisting on this point because
just saying that Connection overrides Proxy-Connection can be confusing
since the default behaviour for the Connection header differs from what
clients have expected for a long time with Proxy-Connection.

I would thus suggest the following rule for clients :

Proxy's HTTP version                 Desired behaviour
                              persistent             close

1.0                    Connection: keep-alive       nothing/close
Unknown                Connection: keep-alive       Connection: close
1.1                    nothing/keep-alive           Connection: close

However the issue remains for responses. In the example I sent this morning,
my old squid 2.6-stable13 was only returning Proxy-Connection: keep-alive
and no "connection" header. This will force clients to still consider the
Proxy-Connection in responses from 1.0 proxies. The real issue precisely is
exactly this case, where Connection is absent and Proxy-Connection returns
something which differs from the implicit connection mode (1.0 without header
means close).

So we can't totally ignore this header but we should be able to prevent it
from being emitted at least.

Regards,
Willy

Received on Monday, 28 November 2011 12:30:08 UTC