Forum Moderators: open

Message Too Old, No Replies

How does a browser download the components of the web page?

         

barun

1:27 pm on Jan 3, 2008 (gmt 0)

10+ Year Member



I have a few queries on browser behavior.

When a web page is loading in a browser, how does it download the components of the web page? Does it download images and text separately or in parallel? Does this behavior differ between browsers?

Can anyone point to any link or tutorial on browser behavior?

Dabrowski

2:51 pm on Jan 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When you request a page from the server, the client will open a HTTP connection for the main HTML file for that page. For every single other element on that page, images, css files, scripts, the browser will open another HTTP connection to the server.

So for example if you have a page, with 15 images, 1 css and 2 scripts, you will need 19 connections. Many of these will happen in parallel, although there is a limit of the maximum number of connections the browser will make to the same server at one time.

penders

4:21 pm on Jan 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



...there is a limit of the maximum number of connections the browser will make to the same server at one time.

In FF this defaults to 8. In the address bar type 'about:config' and search down the list for 'network.http.max-connections-per-server'. Apparently the HTTP standard recommends just two?!

barun

3:50 pm on Jan 4, 2008 (gmt 0)

10+ Year Member



thanks guys.

In the address bar type 'about:config' and search down the list for 'network.http.max-connections-per-server'

my FF shows network.http.max-connections-per-server value of 24!

penders

4:06 pm on Jan 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



my FF shows network.http.max-connections-per-server value of 24!

FF2? Do you have a 'turbo' browser extension installed such as "Fasterfox"?

What is the value of your 'network.http.max-connections'?

[edited by: penders at 4:31 pm (utc) on Jan. 4, 2008]

bcolflesh

4:16 pm on Jan 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



...although there is a limit of the maximum number of connections the browser will make to the same server at one time

It's an arbitrary number hard coded into each browser that you can change - and probably should, especially if you have a high bandwidth connection.

penders

4:51 pm on Jan 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It's an arbitrary number hard coded into each browser that you can change - and probably should, especially if you have a high bandwidth connection.

But should you? Yes, increasing the the max-connections could improve your browsing experience, but you are also putting a much higher load on the server. The server will/should limit the number of concurrent connections per user/ip - it needs to guard against denial-of-service attacks for instance - and I believe this could result in "Access Denied" errors if you are trying to swamp it with connections? So may be tread with caution?

tedster

5:43 pm on Jan 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One interesting way to see the "conversation" between a browser and a server is to use Firefox and install the "LiveHTTPHeaders" extension (also called an "add-on"). When you activate this extension, it opens in a new window and reports all the back-and-forth requests and replies that are going on for any given web page.

Fotiman

6:20 pm on Jan 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Firebug will also give you that information, along with how long each resource took to download (and a whole lot more).

phranque

1:32 am on Jan 5, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Apparently the HTTP standard recommends just two?!

my network.http.max-persistent-connections-per-server is set to 2 for ff2.

barun

11:22 am on Jan 5, 2008 (gmt 0)

10+ Year Member



FF2? Do you have a 'turbo' browser extension installed such as "Fasterfox"?

What is the value of your 'network.http.max-connections'?

I'm using FF 2.0.0.11. I've got Fasterfox installed. my 'network.http.max-connections' value is 48

Dabrowski

9:14 pm on Jan 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Appartently IE logs in the system log if it runs out of available connections. Mine did twice in 6 months, I can live with that.

penders

11:15 am on Jan 6, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Just for the record, the default settings in Firefox(1.5/2) appear to be:

network.http.max-connections ......................... 24 
network.http.max-connections-per-server .............. 8
network.http.max-persistent-connections-per-proxy .... 4
network.http.max-persistent-connections-per-server ... 2

my network.http.max-persistent-connections-per-server is set to 2 for ff2.

Just to quote from MozillaZine - Network.http.max-persistent-connections-per-server [kb.mozillazine.org], "HTTP keep-alive connections can be re-used for multiple requests, as opposed to non-keep-alive connections, which are limited to one request.". Presumably then most connections are not 'persistent'? Which ones are; which ones aren't?