Skip to content

Instantly share code, notes, and snippets.

@gpsarkar
Created June 17, 2018 20:16
Show Gist options
  • Save gpsarkar/e8df356a425894ed66dee901b15d87ee to your computer and use it in GitHub Desktop.
Save gpsarkar/e8df356a425894ed66dee901b15d87ee to your computer and use it in GitHub Desktop.
browser prefetch and performance
Resolve DNS
<link rel="dns-prefetch" href="//example.com">
Resolve DNS and also make the TCP handshake and optional TLS negotiation
<link rel="preconnect" href="http://css-tricks.com">
Fetch and store in cache, Definitely for webfont
<link rel="prefetch" href="image.png">
Same as prefetch, but greater priority than prefetch. So this will be loaded earlier than prefetch
<link rel="subresource" href="styles.css">
Load all resources and render full page in memory, so if user on visit will be shown a superfast cached page.
<link rel="prerender" href="http://css-tricks.com">
Same as prefetch, but prefetch can be ignored by browser (like for large file..), but preload will always be executed.
Not supported by current browsers
<link rel="preload" href="image.png">
More details at : https://css-tricks.com/prefetching-preloading-prebrowsing/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment