Suppose I have two different HTTP clients using the same Squid instance.
The first client, named ClientA, has an aggressive Http read/write and connection timeout of 5 seconds. The other Client, named ClientB, has a very relax timeout of 120 seconds.
My Squid server configurations looks like that:
connect_timeout 1 minute
read_timeout 1 minute
write_timeout 1 minute
Important note: squid's behavior regarding timeouts can change depending on the protocol used. In the case of HTTPS, it cannot inspect the tunneled connection's HTTP headers so it cannot honor any of the
Keep-Alive: timeout=xx values.
Squid will close the outbound connection as soon as it notices the client going away.
Squid will indeed time out, but the result will depend on the protocol used. In the case of HTTP, it will return "
504 Gateway Time-out" and add an additional header "
X-Squid-Error: ERR_READ_TIMEOUT 0".
In the case of HTTPS, it will simply close the connection, because it cannot read or inject headers that would be meaningful to the client.
Not in the squid configuration itself. If you want fine-grained control over your persistent connections' timeouts, you should do so in your clients.
For the record, here are the time-out settings squid will try to honor for persistent connections:
client <-> squid: client_persistent_connections, persistent_request_timeout
squid<->server: server_persistent_connections, pconn_timeout, read_timeout (for HTTPS)