tags:

views:

24

answers:

1

I just ran a load time analysis for a website. The results can be seen here:

http://gtmetrix.com/reports/www.parship.co.uk/VfLleffe

When you check the timeline you will see that some images have a dns lookup time and some do not. Even when the images are on the same subdomain some require a dns lookup and some do not.

Is this totally random? Or is there a way to prevent multiple dns lookups for the same subdomain?

Thanks...

A: 

That's a simple answer - if you reference the images in your html with the site's domain name it will trigger a DNS lookup.

This will not trigger a DNS lookup:

<img src="/logo.png" alt="Site Logo" />

This will trigger a DNS lookup:

<img src="http://www.mysite.com/logo.png" alt="Site Logo" />
Peter Hanneman
References for this alleged behaviour? I've seen YSlow report similar even when all links were relative.
Alnitak
I'll go try to find some but I've seen this from personal experience. Are you using a "/" in front of some of the images and not others? Have you tried setting the base tag in the html header?<base href="www.mysite.com/sitedir/"></base>
Peter Hanneman