title: dns prefetch / pre-resolve hostname - how effective?
body: <p>I've been reading up on how this works but am struggling to make sense of it.</p>
  
  <p>From what I can tell if I set <code>&lt;link rel="dns-prefetch" href="//ajax.googleapis.com" /&gt;</code> in the head of my webpage I <em>should</em> see a faster request completion is I reference any assets on this domain. <a href="http://html5boilerplate.com/docs/DNS-Prefetching/" rel="nofollow noreferrer">[ref]</a></p>
  
  <p>Now there are two issues which are currently bothering me:</p>
  
  <h2>1) Does this only help for future page requests</h2>
  
  <p>What I mean is if I am using Google's CDN to get jQuery <em>on every page in my site</em> will adding the <code>&lt;link /&gt;</code> 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.</p>
  
  <h2>2) How can I test the effectiveness of this?</h2>
  
  <p>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 <code>&lt;link /&gt;</code>!!</p>
  
  <p>I have read the documentation on <a href="https://developer.mozilla.org/En/Controlling_DNS_prefetching" rel="nofollow noreferrer">MDN</a> and <a href="http://blog.chromium.org/2008/09/dns-prefetching-or-pre-resolving.html" rel="nofollow noreferrer">the Chromium Blog</a> (both old!) but I'm still just not getting it.</p>
  
  <p>Any help will be appreciated - thanks!</p>
  
  <p><strong>UPDATE - 22/01/2013</strong></p>
  
  <p>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 <a href="http://csswizardry.com/2013/01/front-end-performance-for-web-designers-and-front-end-developers//#section:dns-prefetching" rel="nofollow noreferrer">he references this issue</a> and links to <a href="http://calendar.perfplanet.com/2012/speed-up-your-site-using-prefetching/" rel="nofollow noreferrer">more research from perfplanet</a>. If anyone have more information / insight about this please add an answer!</p>
  
  <p><a href="https://stackoverflow.com/questions/12874799/dns-prefetching-and-page-optimization">This is a link to another, more recent, SO question</a> - hopefully this will help people find the answers they are looking for.</p>