Book a call Free rebuild
Home/Glossary/Astro/Astro Prefetch

Astro Prefetch

By Seahawk November 16, 2026

Astro glossaryAstro prefetch downloads the next page in the background before a visitor clicks a link marked data-astro-prefetch, so it opens almost instantly.

Astro's prefetch feature downloads the next page in the background before a visitor clicks a link, so it opens almost instantly. It is switched on with prefetch: true in astro.config.mjs and applies to internal links marked with data-astro-prefetch.

Strategies

  • hover (the default): when the link is hovered or focused.
  • tap: just before the link is clicked.
  • viewport: when the link scrolls into view.
  • load: every marked link once the page has loaded.

More eager strategies feel faster but download pages that may never be opened. See also prefetching in general.

Source: Astro docs: Prefetch.

Em Workers

EmDash and Astro sites at revolutionary pricing.

Lightning-fast, secure websites delivered on EmDash and Astro. For the AI-curious bunch.