I have heard for the first time that I can put a line with a domain name in the <head> and the browser is then already searching for the IP address. As a consequence, there would be then no time needed for a DNS Lookup.
So, this would really make sense ...

What I found out was that at least Firefox 3.5+, Chrome 5+ and the IE10 support this tag:

Quote:<link href="//my.domain.com" rel="dns-prefetch" />

The IE9 supports this tag:

Quote:<link href="http://my.domain.com/" rel="prefetch" />

This means that I would need these 2 lines to have an earlier DNS Lookup of the ca. 40 % FF/Chrome users and the ca. 15 % IE9 users of our website ... and maybe other browsers as well as I just read that Safari (15 % of our users) has this feature since the year 2010 (version 5.0.1) as well.

1)
Would it make sense to use the dns-prefetch? Why is nearly nobody using it? According to the article ca. 0,5 % of the pages checked on Alexa.

2)
If so, and I put 15 domains in it ... this would mean ca. 2.000 letters if I put them in ...

Quote:<link href="//my.domain.com" rel="dns-prefetch" />

... and ...

Quote:<link href="http://my.domain.com/" rel="prefetch" />

... which have ca. 50 letters each.

3)
Would it have any negative effect for Google if I make the URLs on my website more similar by having the same lines in the head of all URLs?
Google says no, but I remember a while ago that this had an influence.

RE: DNS Prefetching: Loading the DNS of the domains needed before they are required

If you can you need to cut down the number of domains even if the browser prefetches the DNS for them all then you're still going to have the delay of making the TCP connection and waiting for the TCP window to open wide enough (though some sites will start with a window wide enough for 15KB)

Add 15 prefetch directives will add 2KB (ish) to the page, it's got lots of repeated patterns so should compress well with to gzip.

Perhaps a way to start is to prefetch the DNS for those domains that are needed for page-render to happen and monitor the change in performance, then test whether it's worth adding any more.

RE: DNS Prefetching: Loading the DNS of the domains needed before they are required

Most (modern) browsers will do a really good job finding host names to pre-resolve in their prefetch scanner. Where you will tend to see better benefits is if you have any domains that can not be discovered by looking at the html (i.e. any content injected by javascript or redirects).

RE: DNS Prefetching: Loading the DNS of the domains needed before they are required

Pat, so when I understand correctly, you think that most modern browsers already pre-resolve a domain xyz.com that is in the source code?
But a dns-prefetch of a domain that is e.g. in a JS file and that will load later might make sense?

RE: DNS Prefetching: Loading the DNS of the domains needed before they are required

Yes, Firefox, Chrome and IE9+ are all quite good at parsing the HTML itself and finding any domains referenced on the page and adding an explicit header won't really give them any more info. For things like ads that may go through 3-4 different domains or content that is injected by javascript they can't see in the preload scanner then you would basically be telling the browser about those domains.

I don't provide any special hints on my site though I'm also not doing things like url-encoding small images, etc. I try to go for the best ROI on my time and some of those micro-optimizations aren't worth the dev effort (maybe when nginx pagespeed is beta I might try having some of those automated).

RE: DNS Prefetching: Loading the DNS of the domains needed before they are required

Interesting. Those are some pretty painful lookup times when the browser didn't prefetch (contending with the large downloads going on in parallel). Also looks like the browser didn't do a good job with the prescanner - I stand corrected, nice work.

Which browser were you testing? Just wondering if I need to go ping the Chrome team to take a look :-)