I wrote a site in SvelteKit and the navigation between pages felt really fast because, SvelteKit on hover, runs the load functions of the pages, downloads everything to the client and on click, it goes to the next page instantaneously.
Now, I am rewriting the same site in Next.js and what Next.js does is, when some Link comes in viewport, it downloads some JavaScript bundle and route information etc and only when the link is clicked, the server components are run and sent to the client.
The load functions and server components fetch data from an API and it is somewhat slow. But SvelteKit hides this slowness as it starts the API fetch on hover. There is like 200 ms delay between hover and click for most users and this is enough time for data to be downloaded from the API and sent to client. In Next.js, the server components start the fetch only after a route is requested and it feels noticeably slow. On top of that, some pages have a lot of links (like 50) and the end user will navigate to only one of them. So, it feels like the fetched data and bandwidth are wasted.
So, can I replicate sveltekit's behaviour of fetching everything needed for the route to the client on hover?
PS: I am running everything on SSR by node adapters, no edge. I also have NODE_ENV set to "production" and I run the server using npm run start.
Update: I have updated the docker file to not run the server using npm run start but using node server.js using the instructions here. But the problem remains. Only after I click, I get the payload from the server whereas in SvelteKit, I get the payload to the client on hover.