Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

perf(nuxt): improve link prefetching #8225

Merged
merged 7 commits into from
Oct 17, 2022
Merged

perf(nuxt): improve link prefetching #8225

merged 7 commits into from
Oct 17, 2022

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR bundles a number of improvements to the link prefetching feature of <NuxtLink>:

  1. It implements crossorigin prefetches using the Speculation Rules API - this is behind a flag for experimentation.
  2. It disables prefetching for links with target: _blank as there is no benefit to doing so.
  3. It throttles preload requests (as, the way we do it, these are high priority requests and could block other more urgent user interaction with the page). This implementation could likely be improved but I aimed to keep it lightweight.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added enhancement New feature or request 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing performance labels Oct 15, 2022
@danielroe danielroe requested a review from pi0 October 15, 2022 21:38
@danielroe danielroe self-assigned this Oct 15, 2022
@codesandbox
Copy link

codesandbox bot commented Oct 15, 2022

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify
Copy link

netlify bot commented Oct 15, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit 4154eee
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/634d10e58c5afc000815a382

@pi0 pi0 merged commit 2a4ebfb into main Oct 17, 2022
@pi0 pi0 deleted the feat/prefetch-improvements branch October 17, 2022 11:15
@pi0 pi0 mentioned this pull request Oct 18, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x enhancement New feature or request 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants