Next.js Discord

Discord Forum

Page.js taking such a significant amount of time to load. How can I reduce this load time?

Answered
Thrianta posted this in #help-forum
Open in Discord
ThriantaOP
I'm testing this out on Slow 3G. This happens on the first load only but even then, it takes around 2 seconds to navigate to the page. I've tried wrapping almost every component inside Suspense and it is working because when the page finally loads, all the components are in the loading state. But I can't figure out why there's a delay from when I click to the point when the page has loaded but all the components are in loading state.
Answered by Thrianta
However, I posted the same question on reddit and devs over there told me not to yarn dev and do yarn start instead. Did see quite some performance improvement but a teeny tiny lag is still there.
View full answer

11 Replies

ThriantaOP
This is it. That's my layout file
And this is the page
Well the data in there is quite heavy. A lot of images. But my question is, if everything is wrapped in Suspense, shouldn't the page load instantly? Because the data is getting fetched while all the components are in loading state. And I can see that happening if I try to check with slow3G
ThriantaOP
@joulev
ThriantaOP
There's only 1 library in my entire project and that's swiper. And the components using it are outside the bounds of this route's layout. So when I'm navigating to this specific route, those components are already loaded.
ThriantaOP
However, I posted the same question on reddit and devs over there told me not to yarn dev and do yarn start instead. Did see quite some performance improvement but a teeny tiny lag is still there.
Answer
@Thrianta However, I posted the same question on reddit and devs over there told me not to `yarn dev` and do `yarn start` instead. Did see quite some performance improvement but a teeny tiny lag is still there.
Yes that’s the issue. Don’t measure performance in dev mode. Although things still take time to load, especially in slow 3G, you cannot ask for theoretically instantaneous loading time
ThriantaOP
Thanks!