PDA

View Full Version : The cause of a lot of the loading-lag



Sami_Hamlaoui
2005-12-05, 06:14 PM
I noticed that whenever I go to giantitp.com, I get a lot of "connecting..." "waiting for..." messages in the bottom of the taskbar. This is usually attributed to looking up the IP of the website from the URL, and should only happen once.

Upon checking the source code, it seems that nigh-on EVERY image here, along with every link, uses the full URL, i.e. "http://www.giantitp.com/blahblahblah.html" instead of just "blahblahblah.html". Everytime it encounters a "http://www.giantitp.com/", the IP is looked up. Now, imagine the forums with hundreds of little icons. Yep you guessed it, that's hundreds of IP lookups, making the page load slower for everyone.

The solution? Relative URLS. "http://www.giantitp.com/Shop.html" would be linked to as just "Shop.html" - "http://www.giantitp.com/mb/YaBBImages/embarassed.gif" would be "../../mb/yabbImages/embarassed.gif" (assuming it came from the "Start new topic" page), and so on.

As a former web-developer myself I know these kinds of problems can kill a site without anyone knowing about it - people looking for problems server-side whereas in fact it's all down to the client repeatedly looking up the IP of the server.

GL fixing it :)

RawBearNYC
2005-12-05, 07:18 PM
Um, no...

any browser stupid enough to recheck the IP address for a host it already knows about (and is looking at) deserves what it gets. Moreover, after the images have been seen, they should be getting cached on the end user's machine.

Sadly, it's a function of YaBB that uses the fully qualfied url, if you look at the rest of the site, we used relative links. But I've been logged onto the server and watches what happens. I guarantee you, it's not DNS requests that are slowing things down.