Replies: 4 comments 9 replies
-
I think this is out of the scope of the library. You can achieve that with dynamic imports or using a bundler like Vite that already has it. |
Beta Was this translation helpful? Give feedback.
-
Yeah, would be cool. This is something @claudiodekker has spent some time on (see #223), but it's not something we've had time to finish. Maybe in the future. 👍 |
Beta Was this translation helpful? Give feedback.
-
Wish it was implemented |
Beta Was this translation helpful? Give feedback.
-
Definitely wish this was a feature. Without preloading, Inertia definitely feels much less snappy than other frameworks I've worked with. Next.js in particular feels great. While there is a native prefetch ability in browsers, it doesn't seem to work with Inertia. I assume this is because we're loading JSON. |
Beta Was this translation helpful? Give feedback.
-
Some frameworks offer prefetching and caching of routes to make the application feel snappier. For example, Sapper implements the
prefetch
attribute ona
tags, which will cause the route to be preloaded as soon as the user hovers over the link, and instantly replaces the content when the user clicks it.Other frameworks, like Turbolinks, cache whole routes, so that the user is briefly presented with stale content after navigation, while the "fresh" content is being loaded in the background.
My proposal here is for Inertia to implement something similar via prefetching and caching page objects.
Would like to hear thoughts.
Beta Was this translation helpful? Give feedback.
All reactions