Why is Next.js slow when you click between page or refresh page, it take more like 5 second to load?
Unanswered
Mini Rex posted this in #help-forum
Mini RexOP
This happen during development.
8 Replies
@Mini Rex This happen during development.
nextjs first needs to load the server components and then the client ones
so if u have async components they have to complete before router pushes
Mini RexOP
Isn't there a way to optimize, to improve the performance of loading the page faster?
@Mini Rex u can suspend serverside components and show some loading ui before their promise finishes, take a look at the docs, i use it all the time
if that helped u make sure to mark my answer as solution v
@Mini Rex This happen during development.
dev mode is slow, that's normal.
firstly, the compiled versions of the pages during dev mode is not optimised, and significantly bigger than the bundle you would get in production mode.
secondly, the pages are only compiled and built on-demand. in other words, nextjs only builds the page when you navigate to it.
thirdly, the dev server is infamously known for its slowness
firstly, the compiled versions of the pages during dev mode is not optimised, and significantly bigger than the bundle you would get in production mode.
secondly, the pages are only compiled and built on-demand. in other words, nextjs only builds the page when you navigate to it.
thirdly, the dev server is infamously known for its slowness