✨ Route prefetch #873
kevintakeda
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Having a built-in capability to prefetch data and components from links effortlessly in the background would greatly enhance the ux, making it feel near-instantaneous.
While I'm not entirely familiar with the specific implications, here's the general idea: If the provided link contains both retrievable data and components, one potential strategy could be to initially retrieve the components present in the route, along with the required data throughout. It could be beneficial to store all of this information in a cache for a specified period.
Here are some ideas from frameworks that support some sort of route prefetching: Next.js, Sveltekit, Nuxt, Astro, Qwik, quicklink (library).
I personally like the svelte implementation, it allows you to choose the desired prefetching "eagerness" (examples are: on hover or as soon as the link becomes visible in the viewport), it also provides the option to opt out of data prefetching while specifically prefetching solely the code.
Beta Was this translation helpful? Give feedback.
All reactions