Forum Moderators: open

Message Too Old, No Replies

base href vs. http requests etc

         

juglesh

11:48 pm on Oct 6, 2006 (gmt 0)

10+ Year Member



Hello, i am wondering about
<base href="thedomain.com" />
. I then have my images and such like this
<img src="/img/thepicture.jpg">
. It works fine, no matter where in the dir structure the page is.

My question is, having the base href set like that, isnt it the same as having an absolute url for your images, like

<img src="http://thedomain.com/img/thepicture.jpg">
? Which is bad for download times? isnt that bad for server load as well?

Thanks for clearing this up for me,
juglesh

tedster

2:00 am on Oct 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The only issue I know of is that absolute urls take up more space in the html - thus creating a larger file size for the html document. Even though html is text and compresses well, this still means a few more packets and therefore slightly longer download time for the html document when you use all absolute urls in the mark-up.

But using a <base href> tag instead of writing out all those absolute urls eliminates most of that extra mark-up, so I don't know of any real downside here in terms of a performance hit. The url "conversions" take place in the browser or user agent -- there's no difference on the server to my knowledge.

piatkow

11:17 am on Oct 8, 2006 (gmt 0)

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



I read long ago that using the full domain name required a DNS lookup each time. I have no idea if that was correct or not but in the days when 56k dial up was considered a superfast connection it was the sort of tweak that you had to worry about.

These days I would pay far more attention to keeping every internal link in a consistent format as that is supposed to keep Google happy.