I've been reading up on how this works but am struggling to make sense of it.
From what I can tell if I set <link rel="dns-prefetch" href="//ajax.googleapis.com" />
in the head of my webpage I should see a faster request completion is I reference any assets on this domain. [ref]
Now there are two issues which are currently bothering me:
1) Does this only help for future page requests
What I mean is if I am using Google's CDN to get jQuery on every page in my site will adding the <link />
above any difference? Or will it only help if, say, I am not referencing the CDN on my homepage but am on all other pages? In this second option the user would hit the homepage, resolve and cache the DNS host ready for the download on my content pages.
2) How can I test the effectiveness of this?
I suppose if I knew the answer to this I'd have a better understanding of issue 1. I'm trying to use Firebug and Chrome developer tools and watching the Net and Resources panels but I'm seeing no significant difference. The only trend I can see is that, if anything, it is taking longer to complete my request when I'm using the <link />
!!
I have read the documentation on MDN and the Chromium Blog (both old!) but I'm still just not getting it.
Any help will be appreciated - thanks!
UPDATE - 22/01/2013
Just read some more around this issue and thought I should include the links for people with this same question. csswizardry has written a great article on performance in which he references this issue and links to more research from perfplanet. If anyone have more information / insight about this please add an answer!
This is a link to another, more recent, SO question - hopefully this will help people find the answers they are looking for.