Skip to content

Instantly share code, notes, and snippets.

@nucliweb
Forked from droom/Resource Hints
Created September 10, 2021 09:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nucliweb/632838578cdff8d8548bbadd846cd04d to your computer and use it in GitHub Desktop.
Save nucliweb/632838578cdff8d8548bbadd846cd04d to your computer and use it in GitHub Desktop.
Hints to the browser that might prime the pump for resources you will need. PreLoad is the only exception here, being more of an instruction than just a hint.
by Addy Osmani (@addyosmani)
https://twitter.com/addyosmani/status/743571393174872064
———
Preresolve DNS hostnames for assets
<link rel="dns-prefetch" href="https://my-site.com">
Begin a connection handshake in the background
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
Declaratively fetch a resource without executing it
<link rel="preload" href="late_script.js" as="script">
Prefetch a resource for a future navigation
<link rel="prefetch" href="images/large.ipg">
Prerender a page in the background for future nav
<link rel="prerender" href="next.html">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment