Skip to content

Instantly share code, notes, and snippets.

@nepsilon
Last active November 18, 2019 07:09
Show Gist options
  • Save nepsilon/3f1f160416a7a84887aa to your computer and use it in GitHub Desktop.
Save nepsilon/3f1f160416a7a84887aa to your computer and use it in GitHub Desktop.
Faster webpages with Resource Hints — First published in fullweb.io issue #18

Faster webpages with Resource Hints

Make your web pages faster with Resource Hints <link> tags! They are a great and simple way to tell the browser you need other resources for an optimal user experience.

The browser support is already pretty good to start using them today.

Pre-DNS resolve a domain:

<link rel="dns-prefetch" href="//widget.com"> 

**Pre-connect to a domain HTTP endpoint:

<link rel="preconnect" href="//cdn.example.com"> 

Pre-fetch a resource, here an image needed on the page:

<link rel="prefetch" href="//example.com/logo.jpg" as="image"> 

Pre-render a web page, here for the next page of an article:

<link rel="prerender" href="//example.com/next-page.html">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment