HTML <link rel> tags

·

1 min read

Preload, prefetch and other tags

What’s even cooler is that browsers have a simple built-in way to do all these things. There’re six tags that instruct the browser to preload something:

linkTags.png

prefetch – when you need a resource for the next page

preload – when you’re going to need a resource in a few seconds

preconnect – when you know you’ll need a resource soon, but you don’t know its full url yet

dns-prefetch – when you know you’ll need a resource soon, but you don’t know its full url yet (for older browsers)

prerender – when you’re certain most users will navigate to a specific page, and you want to speed it up

modulepreload – when you’re going to need an ES module script soon