πŸŽ‰ We just launched our new React course! Get it with 20% off! πŸŽ‰
How to Load Resources With Priority in HTML

How to Load Resources With Priority in HTML

Ferenc Almasi β€’ 2020 September 18 β€’ πŸ“– 1 min read
  • twitter
  • facebook

With the preload attribute in HTML, you can implement different loading strategies for high priority resources.

<!-- Load resources with priority using preload -->

<link rel="preload" href="style.css" as="style" />
<link rel="preload" href="app.js" as="script" />
download.html
Copied to clipboard!

This will ensure that critical resources that are needed for the page are fetched early, which can improve performance. Make sure to also specify the type of resource with the as attribute.

Among many, you can mark fonts, images, styles, scripts or videos and audios as a priority resource.

For the full list of available options, you can check out MDN's official documentation.

How to Load Resources With Priority in HTML
If you would like to see more Webtips, follow @flowforfrank

10 Best Practices for HTML
Looking to improve your skills? Check out our interactive course to master JavaScript from start to finish.
Master JavaScript

Resources:

JavaScript Course Dashboard

Tired of looking for tutorials?

You are not alone. Webtips has more than 400 tutorials which would take roughly 75 hours to read.

Check out our interactive course to master JavaScript in less time.

Learn More

Recommended