Slow Page Load
Answered
Yellowstripe scad posted this in #help-forum
Yellowstripe scadOP
Hi guys,
I am experiencing some slow load page, on my local environment when switching between pages.
This is obviously because of SSR, and the page is firstly fetched and data from the DB is fetched and then the HTML is generated.
Is there a way to show a client sided component as a preloading component? Whether that be a loader, or a spinner animation or anything like this? There is no feedback to the user to suggest that they have switched pages after clicking a link, as the page holds for 3-4 seconds, until the redirected page is ready.
I am experiencing some slow load page, on my local environment when switching between pages.
This is obviously because of SSR, and the page is firstly fetched and data from the DB is fetched and then the HTML is generated.
Is there a way to show a client sided component as a preloading component? Whether that be a loader, or a spinner animation or anything like this? There is no feedback to the user to suggest that they have switched pages after clicking a link, as the page holds for 3-4 seconds, until the redirected page is ready.
Answered by Asian black bear
Local speeds are not representative of speeds in production because locally the files are compiled on request. If you want loading indicators use suspense boundaries or the loading.tsx file.
10 Replies
Asian black bear
Local speeds are not representative of speeds in production because locally the files are compiled on request. If you want loading indicators use suspense boundaries or the loading.tsx file.
Answer
@Asian black bear Local speeds are not representative of speeds in production because locally the files are compiled on request. If you want loading indicators use suspense boundaries or the loading.tsx file.
Yellowstripe scadOP
Completly forgot of the existance of loading.txt 

Thank you
Leafcutting bee
I've seen pages in production that loads slow as well
I am having this same issue in dev, my first time building a NextJS project. It's an e-comm platform, but in dev compiles really slow. I've been thinking of adding a page loading indicator as well but that doesn't solve the page load
I am having this same issue in dev, my first time building a NextJS project. It's an e-comm platform, but in dev compiles really slow. I've been thinking of adding a page loading indicator as well but that doesn't solve the page load
@Leafcutting bee I've seen pages in production that loads slow as well
I am having this same issue in dev, my first time building a NextJS project. It's an e-comm platform, but in dev compiles really slow. I've been thinking of adding a page loading indicator as well but that doesn't solve the page load
Saint Hubert Jura Hound
Its best to create your own post for this w more info ab what pages load slowly
@Saint Hubert Jura Hound Its best to create your own post for this w more info ab what pages load slowly
Leafcutting bee
it's the same challenge, don't want to create duplicate posts. dont know if that is against the community rule
@Leafcutting bee it's the same challenge, don't want to create duplicate posts. dont know if that is against the community rule
Saint Hubert Jura Hound
U said pages in production which is different from what is being talked about here. Also i think every time we chat here the original person gets pinged. Best to make ur own post for it
@Leafcutting bee it's the same challenge, don't want to create duplicate posts. dont know if that is against the community rule
Its not against the community rule, dont worry. Its generally advisable to look for existing posts just to see if anyone had solved it but no rules against posting your own issue.
@Saint Hubert Jura Hound U said pages in production which is different from what is being talked about here. Also i think every time we chat here the original person gets pinged. Best to make ur own post for it
The original person don't get pinged, dont worry. Unless i reply to you like this.
@ididntdoshi The original person don't get pinged, dont worry. Unless i reply to you like this.
Saint Hubert Jura Hound
Ahh okay good to know, i kinda vaguely do remember getting pinged every time last time i made this but ig im misremembering