[clug] browser connection question
David Deaves
David.Deaves at dd.id.au
Mon Aug 17 06:04:04 UTC 2015
> On 17/08/15 10:49, David Deaves wrote:
> >
> >> First, I apologise for interrupting the less technical discussions going on...
> >>
> >> I start firefox and have nothing open. I am observing the activity on my privoxy log.
> >>
> >> I connect to DuckDuckGo and see that connection in the log.
> >> Without any query I close the window, then even clear cookies and the cache.
> >>
> >> About 3 minutes later I see a connection
> >> "CONNECT duckduckgo.com:443 HTTP/1.1" 200 257620
> >> The log shows activity without delay and the messages are timestamped anyway.
> >>
> >> What is causing this? I expected the closed tab to be done with this site.
> >
> > Your browser is being helpful. Setting up a SSL connection is costly, and
> > HTTP/1.1 allows multiple requests over one connection. So when you first
> > connected to duckduckgo it opened the SSL connection, but rather than close it
> > immediately only to have to open it again later, it keeps it open for future
> > use. After a period of no use it prunes the no longer required connection.
> > The same is true of regular TCP connections, they are not as costly as SSL,
> > but caching connections is still of value.
>
> I understand caching, but do not see why a new connection is required when dropping
> the idle connection - after all the connection is cached and alive already.
>
There is no specific mapping of page displays to conections. One requirement
of re-using a connection is that any replies include a 'content-length:' field
in the header. If a requested item does not have a predictable length (for
what ever reason) the then end of the response has to be indicated by the connection
close. Remember that the log entry happens a connection close, not when it is
started. Your log lines would also normally include a duration (in seconds)
often the 2nd field, directly after the timestamp. Subtract that from the
timestamp and I expect you will find the connection was actually opened during
the initial page display.
Dave !
More information about the linux
mailing list