Firefox Strangeness

sechs

Storage? I am Storage!
Joined
Feb 1, 2003
Messages
4,709
Location
Left Coast
I was having problems with slow page load times in Firefox. I initially thought that maybe it was a DNS problem, or something that I had done to gum up the works. I read this page, turned off keep-alive, and all is solved.

Can any of your webmonkeys explain what is going on?
 

timwhit

Hairy Aussie
Joined
Jan 23, 2002
Messages
5,278
Location
Chicago, IL
Connection keep-alive basically tells the browser/server to keep the connection alive so that it can be used for future requests. This way you don't have overhead for opening and closing a new connection for every request/response. The problem is that if the web server doesn't send a content-length attribute in the response header the browser doesn't know if all the data was sent or not. So, it keeps waiting and waiting until it hits some kind of time-out, which could be 30 seconds or 5 minutes.
 

Santilli

Hairy Aussie
Joined
Jan 27, 2002
Messages
5,278
Timwhit:
What does that add on do?

It makes stuff load pretty much instantly. Amazing...
 

Santilli

Hairy Aussie
Joined
Jan 27, 2002
Messages
5,278
HMMM.

I've been looking for something that would show the source of some of the annoying Flash adds, etc., so I could block them in Firefox.

I gather I can do this with this program, and Firefox?
 

timwhit

Hairy Aussie
Joined
Jan 23, 2002
Messages
5,278
Location
Chicago, IL
All that Live HTTP Headers does is show your request header that gets sent to the server and the response header that the server sends back. I doubt it makes anything faster. I mainly use it for troubleshooting purposes.
 

sechs

Storage? I am Storage!
Joined
Feb 1, 2003
Messages
4,709
Location
Left Coast
Connection keep-alive basically tells the browser/server to keep the connection alive so that it can be used for future requests. This way you don't have overhead for opening and closing a new connection for every request/response. The problem is that if the web server doesn't send a content-length attribute in the response header the browser doesn't know if all the data was sent or not. So, it keeps waiting and waiting until it hits some kind of time-out, which could be 30 seconds or 5 minutes.
So why would this cause pages to load slowly?
 

timwhit

Hairy Aussie
Joined
Jan 23, 2002
Messages
5,278
Location
Chicago, IL
Here's my understanding: when Firefox starts receiving HTML markup in the response it won't start rendering the page until it has received all the markup. This is particularly true with poorly written markup (missing closing tags). So, if the browser can't tell when the end of the response is received because there is no content-length it won't start rendering or finish rendering the page until some kind of time out is reached.
 

sechs

Storage? I am Storage!
Joined
Feb 1, 2003
Messages
4,709
Location
Left Coast
Ahhh. Gotcha.

Is there some reason that this would have relatively recently become such an issue for me?
 

timwhit

Hairy Aussie
Joined
Jan 23, 2002
Messages
5,278
Location
Chicago, IL
I was just re-reading the article that sechs linked to in the first post and they say to change the Firefox setting to not do keep-alive. I don't think I would do that. Keep-alive will significantly reduce the number of TCP connections that are required to GET most pages. I would bet that this would make everything slower, but I haven't played with that setting. The performance hit is also going to depend on what site you are hitting. If it's only a couple of quick hops away it would probably be unnoticeable, however if it's a site on another continent performance will probably suffer significantly.
 

timwhit

Hairy Aussie
Joined
Jan 23, 2002
Messages
5,278
Location
Chicago, IL
I've been doing more research on this and have found that under certain circumstances content-length is unnecessary. If content is generated dynamically many times the transfer-encoding will be set to chunked and then a content-length is unnecessary.

See the technical explanation.
 

sechs

Storage? I am Storage!
Joined
Feb 1, 2003
Messages
4,709
Location
Left Coast
Alright then. Why does flipping this option seem to speed up page loading when, as you seem to say, it should slow it down, if anything?
 
Top