Subject: HTTP1.1 Proxy, clients multiple persistent connections

From: Přemysl Kouřil <[email-masked]>
Date: Wed, 03 Mar 2004 00:03:54 +0100 (CET)

I'am doing HTTP1.1 Proxy and have a question about persistent connections. After reading RFC 2616 I though that client (I use Mozilla 1.5) will maintain persistent connection as long as possible (and will sending requests to this connection as long as possible) but when I set as a proxy my proxy server and send request to fetch some web page, client makes persistent connection between him and proxy, and some requests goes by this connection (as I expected), but for some other requests client wants to make new connection between him and proxy (as I dont expected) even though the previous persistent connection between client and proxy is still up (so I think that making new connection is unnecessary because client can send this request by existing connection between him and proxy). My question is why client makes new connections to proxy when another persistent connection between same client and same proxy exists. Thanks

Premysl Kouril

---

From: Alex Rousskov <[email-masked]>
Date: Tue, 2 Mar 2004 16:17:22 -0700 (MST)

On Wed, 3 Mar 2004, [iso-8859-2] Pøemysl Kouøil wrote:

> why client makes new connections to proxy when another persistent
> connection between same client and same proxy exists.

HTTP clients are not obligated to limit the number of concurrent
persistent connections.  For example, a client may use 1000 concurrent
persistent connections without violating any HTTP MUST.

Many clients open more than one connection to decrease real or
perceived response (download) time in case a large object or another
delay slows down responses on one connection.

HTH,

Alex.

---

From: David Morris <[email-masked]>
Date: Tue, 2 Mar 2004 15:23:26 -0800 (PST)

Clients can of course do what they wish so you really need to ask this
question on a Mozilla related list.

Multiple connections may happen when the client discovers that the
existing connection is busy. Probably other logical reasons.

You should also confirm that Mozilla is configured for HTTP/1.1 for
proxies. Could be that you code thinks the connection is open but
Mozilla believes it closed. How long an existing connection continues to
be used is up to the both ends of the connection. I would expect it to be
on the order of 30 seconds of idle time but that is my personal design
style.

Dave Morris

PS. It would be helpful if you configure your mail client to sent the
subject in plain ascii ...

On Wed, 3 Mar 2004, [iso-8859-2] Pøemysl Kouøil wrote:

>
> I'am doing HTTP1.1 Proxy and have a question about persistent connections. After reading RFC 2616 I though that client (I use Mozilla 1.5) will maintain persistent connection as long as possible (and will sending requests to this connection as long as possible) but when I set as a proxy my proxy server and send request to fetch some web page, client makes persistent connection between him and proxy, and some requests goes by this connection (as I expected), but for some other requests client wants to make
> new connection between him and proxy (as I dont expected) even though the previous persistent connection between client and proxy is still up (so I think that making new connection is unnecessary because client can send this request by existing connection between him and proxy). My question is why client makes new connections to proxy when another persistent connection between same client and same proxy exists. Thanks
>
> Premysl Kouril
>

---

From: Robert Olofsson <[email-masked]>
Date: Wed, 03 Mar 2004 01:04:09 +0100

>why client makes new connections to proxy when another persistent connection between same client and same proxy exists. Thanks
>
One of the reasons is usually that you can start displaying the page if 
you have the top (of a long page)
and the images at the top.  If I remember correctly mozilla will not 
pipeline on the main connection
for a page (they will reuse the main connection as an ordinary 
persistent connection when the main
page is fetched). They do this since the page is normally large, and the 
images in it are many and small.
If they do not pipeline on the main connection, they want several 
threads to start getting the images
that are needed. 

If they can start display the page correctly  quick and load the rest 
with only the scrollbars updating
the user will think that the browser is faster giving a more happy user.
Of course the total time to download a page with images takes a bit 
longer for each extra connection,
but experienced user time is not equal to total time...

I may be wrong about how mozilla is doing  things now though, but I 
still belive that they do it like
this (or has tweakable options for this).

/robo