Skip to content

Instantly share code, notes, and snippets.

@jhafner
Created June 5, 2013 14:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhafner/5714392 to your computer and use it in GitHub Desktop.
Save jhafner/5714392 to your computer and use it in GitHub Desktop.
HTML5 DNS Prefetching and Link Prefetching/Prerendering. Source: http://daker.me/2013/05/5-html5-features-you-need-to-know.html
<!--
DNS hostname resolution is one of the issues that can make any website slow. Modern browsers start to be very smart when it comes to DNS resolution, they try to resolve domain names then cache them before the user tries to follow any link on the webpage.
With the dns-prefetch feature you are allowed to manually control this operation by telling the browser which domain names to resolve
-->
<link rel="dns-prefetch" href="//fonts.googleapis.com">
<link rel="dns-prefetch" href="//google-analytics.com">
<link rel="dns-prefetch" href="//www.google-analytics.com">
<link rel="dns-prefetch" href="//platform.twitter.com">
<!--
Link prefetching allows developers to specify pages or assets they want to silently preload once the page load, like loading the first search results.
-->
<link rel="prefetch" href="http://daker.me/2013/05/hello-world.html" />
<link rel="prefetch" href="http://daker.me/assets/images/avatar.png" />
<!--
Also you can use the prerendering feature which will make your website even faster, the browser will fetch and render the entire next page on the background and show it only when the user click on the link.
-->
<link rel="prerender" href="http://daker.me/2013/05/hello-world.html" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment