- HTML Higest priority
- Styles Higest priority, Stylesheet referenced with
@import
are also highest priority - Images
- Low priority, if outside the viewport
- Upgraded to medium priority, when they should be rendered in the visible viewport
- Ajax/XHR/fetch() High priority
- Scripts
<script></script>
High, when appearing in the markup before and image<script></script>
Medium, when appearing in the markup after an imageasync
/defer
Lowtype="module"
Low
- Fonts Are usually delayed, after the stylesheet (with the respecting
@font-face
declaration) has been loaded.
<link rel="preload" href="font.woff" as="font">
instructs the browser to addfont.woff
to the browser's download queue at High priority. Also acceptsmedia=""
attributes, which will priorize basen on @media query rules:<link rel="preload" herf="article-lead-sm.jpg" as="image" type="image/jpeg" media="only screen and (max-width: 48rem)">
Make use of the font-display
property:
swap
Will display the fallback font until the real web font is loaded (Chrome, Opera)optional
Sources: