-
Notifications
You must be signed in to change notification settings - Fork 36
Support prefetch in core #754
Copy link
Copy link
Closed
Description
- Accepted Date: 2023-11-01
- Reference Issues/Discussions: Support prefetch in core #749
- Author: @bluwy
- Champion(s): @bluwy
- Implementation PR: Support prefetch in core astro#8951
Summary
Deprecate @astrojs/prefetch and provide first-class prefetch support in Astro.
Background & Motivation
With the introduction of View Transitions, it includes partial prefetching code for snappy navigation between pages. We can take this opportunity to support prefetching in core, and share the prefetch behaviour with View Transitions.
I've started an implementation before an RFC as the initial plan was to simply move @astrojs/prefetch to core. However, it would also be a good time to polish up and extend the API.
Goals
- An option to enable prefetching
- Enable prefetching via an attribute/hint
- Enable prefetching for all links by default (required by View transitions)
- Disable prefetching if all links are enabled by default
- Different prefetching strategies (click, hover, viewport, etc)
- Only add JS if using prefetching
Non-Goals
- Prefetch cache invalidation (Browser relies on cache control)
- Prefetch external links
NOTE: Stage 2 does not mention solution details, but I've written one in the discussion: withastro/astro#8951
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Implemented