Skip to content

Instantly share code, notes, and snippets.

@droom
Last active September 26, 2021 00:35
Show Gist options
  • Save droom/77fb9c4c0ed4da3ff475b1e404de14f5 to your computer and use it in GitHub Desktop.
Save droom/77fb9c4c0ed4da3ff475b1e404de14f5 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