Jan-14, 2024 · 3min
change languageUnderstanding the difference between preload and prefetch HTML link attributes for resource optimization and performance improvement
<link rel="preload">
is used to preload resources that are needed for the current page
, and it is loaded before the browser parses the HTML document.
<link rel="preload" href="https://example.com/image.png" as="image" />
<link rel="prefetch">
is used to prefetch resources that will be needed for the future pages
, and it is loaded after the browser parses the HTML document.
<link rel="prefetch" href="https://example.com/image.png" as="image" />