Overview

Prefetching aims to speed up future navigations by downloading assets (like the code for the next page) while the user is still on the current page. This happens during idle time so it doesn't interfere with the current page's performance.

Types of Prefetching

  • Link Prefetching: <link rel="prefetch" href="..."> downloads a resource for a future navigation.
  • DNS Prefetching: <link rel="dns-prefetch" href="..."> resolves the IP address of a domain before the user clicks a link.
  • Data Prefetching: Fetching data for a future state in a single-page application.

Benefits

Makes subsequent page loads feel near-instant, significantly improving the perceived performance of the application.

Related Terms