A couple of pconn questions;

1) Squid supports HTTP/1.0-style persistent connections; i.e., if it gets a request with a Connection: keep-alive header in it, it will reuse the connection.

However, if it receives a HTTP/1.1 request, it will fall back to one- request-per-connection. Since pconns are the default in HTTP 1.1, why not use them?

In client_side.c, line 597 (clientSetKeepaliveFlag);

---8<---
httpBuildVersion(&http_ver, 1, 0); /* we are HTTP/1.0, no matter what the client requests... */
        if (httpMsgIsPersistent(http_ver, req_hdr))
            request->flags.proxy_keepalive = 1;
    }
--->8---

would need to be

---8<---
        if (httpMsgIsPersistent(request->http_ver, req_hdr))
            request->flags.proxy_keepalive = 1;
    }
--->8---

httpMsgIsPersistent already appears to do the right thing. Are there any particular reasons why this is disabled? While Mozilla and IE still send Connection: keep-alive with 1.1 requests, Safari does not...

2) Squid still sends Proxy-Connection headers. As far as I can see, they're not required by any modern implementations; everybody understands Connection. Maybe it's time to stop generating them?

3) Squid can't persist client-side connections if it doesn't have a Content-Length handy, so if the origin server doesn't provide one, it'll close. However, responses cached by Squid -- by their very nature -- have a C-L available to Squid, even if the origin server doesn't send one. Since content generated by scripts often doesn't have C-L set, but can sometimes be cacheable, it would be a nice optimisation to synthesise the response body length if you don't have a C-L on a cached response. Has anyone attempted this?

Cheers,

--
Mark Nottingham
[EMAIL PROTECTED]



Reply via email to