kb/data/developer.mozilla.org/en-US/docs/Glossary/Prefetch-0.md

12 KiB

title chunk source category tags date_saved instance
Prefetch - Glossary | MDN 1/3 https://developer.mozilla.org/en-US/docs/Glossary/Prefetch reference web, html, css, javascript, documentation 2026-05-05T05:40:36.414248+00:00 kb-cron

MDN HTML HTML: Markup language

HTML reference

HTML guides

Markup languages

CSS CSS: Styling language

CSS reference

CSS guides

Layout cookbook

JavaScriptJS JavaScript: Scripting language

JS reference

JS guides

Web APIs Web APIs: Programming interfaces

Web API reference

Web API guides

All All web technology

Technologies

Topics

Learn Learn web development

Frontend developer course

Learn HTML

Learn CSS

Learn JavaScript

Tools Discover our tools

About Get to know MDN better

Blog

  1. Glossary
  2. Prefetch

Prefetch

Prefetching refers to the practice of speculatively fetching documents or subresources in the background for pages that the user is likely to navigate to in the near future. This can significantly reduce the load time for the prefetched page if the user does choose to navigate to it. Prefetching might be used, for example, to fetch the page linked by a "Next" button or its subresources, or a link popup that a user hovers over, or search results.

In this article

Resource prefetching

Resources should be prefetched based on how likely it is that they will be needed in a future navigation. Browsers can infer this automatically for some resources, such as the current URL in the address bar. This can be done using <link rel="prefetch"> (the Speculation Rules API only handles document prefetches for navigations):

Document prefetching

Developers can provide hints to the browser of navigations that should be prefetched in a couple of different ways: <link rel="prefetch">: Speculation Rules API prefetch: The Speculation Rules API handles document prefetches for navigations much better than <link rel="prefetch">; the former was designed specifically for that purpose whereas the latter has a number of limitations; see <link rel="prefetch"> for details.

DNS prefetching

DNS prefetching resolves domain names in advance, speeding up load times by reducing the time associated with domain lookup at request time.

See also