Use DNS prefetching to speed up web font loading

Poking around in a framework today, I saw they’d suggested using the new dns-prefetching feature in HTML5 to speed up resolving some foreign domains. Further digging showed folks are prefetching the domains from which Google serve their web fonts. It’s a great idea, given that web fonts are one of the biggest contributors to page weight on a largely text web site.

To include prefetching of the Google web fonts domains in your page, add the following code to your head:

<link rel="dns-prefetch" href="//themes.googleusercontent.com">
<link rel="dns-prefetch" href="//fonts.googleapis.com">