Skip to content

Prefetch and/or prerender pages when likely navigated to#13296

Merged
sfshaza2 merged 2 commits intomainfrom
feat/speculation-rules
Apr 21, 2026
Merged

Prefetch and/or prerender pages when likely navigated to#13296
sfshaza2 merged 2 commits intomainfrom
feat/speculation-rules

Conversation

@parlough
Copy link
Copy Markdown
Member

Implements a mechanism to specify pages to be prefetched and prerendered when likely navigated to, improving page loading speed and making website navigation feel more snappy and seamless.

  • If a page has a next (page) specified, prerender it.
    • This for example, makes navigating to the next lesson in the tutorial feel immediate.
  • If a page has prev (page) specified, prefetch it.
  • If on the homepage, prefetch the pages linked to in the top nav.
  • On any page, prefetch a page if hovering a link to it.
  • On any page, prerender a page if beginning to click a link to it.

Note that the Speculation Rules API this relies on mostly only works on Chromium-based browsers currently with WebKit having some initial support.

@parlough parlough requested review from a team and sfshaza2 as code owners April 21, 2026 15:55
gemini-code-assist[bot]

This comment was marked as resolved.

@flutter-website-bot
Copy link
Copy Markdown
Collaborator

flutter-website-bot commented Apr 21, 2026

Visit the preview URL for this PR (updated for commit 952f1fb):

https://flutter-docs-prod--pr13296-feat-speculation-rules-7bbem4ir.web.app

Copy link
Copy Markdown
Contributor

@sfshaza2 sfshaza2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sfshaza2 sfshaza2 merged commit b9d3325 into main Apr 21, 2026
10 checks passed
@sfshaza2 sfshaza2 deleted the feat/speculation-rules branch April 21, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants