Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive

perf(nuxt): improve link prefetching - #8225

Merged
pi0 merged 7 commits into
mainfrom
feat/prefetch-improvements
Oct 17, 2022
Merged

perf(nuxt): improve link prefetching#8225
pi0 merged 7 commits into
mainfrom
feat/prefetch-improvements

Conversation

@danielroe

Copy link
Copy Markdown
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.

@danielroedanielroe 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 pi0October 15, 2022 21:38
@danielroedanielroe self-assigned this Oct 15, 2022
@codesandbox

Copy link
Copy Markdown

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

@netlify

netlifyBot commented Oct 15, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

NameLink
🔨 Latest commit4154eee
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/634d10e58c5afc000815a382

Comment threadpackages/nuxt/src/app/components/nuxt-link.ts Outdated
Comment threadpackages/nuxt/src/app/composables/preload.ts
pi0
pi0 approved these changes Oct 17, 2022
@pi0
pi0 merged commit 2a4ebfb into mainOct 17, 2022
@pi0
pi0 deleted the feat/prefetch-improvements branch October 17, 2022 11:15
@pi0pi0 mentioned this pull request Oct 18, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.xenhancementNew feature or request🍰 p2-nice-to-havePriority 2: nothing is broken but it's worth addressingperformance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@danielroe@pi0@Aareksio