I have a remote webserver listening on port 80, which serves a page which loads 100 individual
.png files (from the same server and hostname) via 100
<img /> tags. On that remote server I do
watch -n 1 "netstat -na | fgrep ":80 " | fgrep 188.8.131.52" (where
184.108.40.206 is the external IP of my client computer) and when I visit that page I usually see around 5-6 connections made to the server from my client computer. I use chrome or firefox to do that page request and by inspecting any of those requests (either of the page or of any of the png files) using the F12 dev tools I see the request header
Connection:keep-alive. I also confirm via looking at the webserver logs that all of those requests are done using
HTTP/1.1 which I think uses keep alive by default.
All the above facts and observations mean that the 101 requests (1 page + 100 pngs) go through 5-6 connections, and not through 101 connections.
My question is, how can I disable keep alive in chrome or firefox?
In firefox I tried setting the following in
about:config but it didn't change anything in this behavior:
network.http.keep-alive.timeout;0 network.http.tcp_keepalive.long_lived_connections;false network.http.tcp_keepalive.long_lived_idle_time;0 network.http.tcp_keepalive.short_lived_connections;false network.http.tcp_keepalive.short_lived_idle_time;0 network.http.tcp_keepalive.short_lived_time;0 network.tcp.keepalive.enabled;false network.tcp.keepalive.idle_time;0 network.tcp.keepalive.retry_interval;0
I'd be OK if I had to do something on O/S level (windows or linux) to disable keep alive, use a different (even custom) browser or even use some sort of web proxy which would cancel this behavior for me.