prefetch()
Environment: browser.
By using prefetch('/some/url')
you can programmatically prefetch pages.
Using prefetch()
enables you to speed up page navigation when you can predict what the next page will (most likely) be.
For example:
Without vike-{react,vue,solid}
If you don't use a UI framework Vike extension vike-react
/vike-vue
/vike-solid
, then you need to use Client Routing to be able to use prefetch()
. Prefetching doesn't work with Server Routing.