Slow simple RSC Page taking 5 seconds to load
Unanswered
Netherland Dwarf posted this in #help-forum
Netherland DwarfOP
Hello!
I have a page that on top fetches an endpoint for some information, and then I pass it down to 4 other components (3 of them are clients, other is a server).
My problem is that it takes 5 to 6 seconds for the page to show up. I did a suspense on the layout, and I saw the fallback for 5 to 6 seconds.
The components are fairly simple and the fetch takes 100ms to complete, I have no idea what it could be, by watching the browser profiler, I see a 5-second Idle.
This happens every time I refresh the page.
I have a page that on top fetches an endpoint for some information, and then I pass it down to 4 other components (3 of them are clients, other is a server).
My problem is that it takes 5 to 6 seconds for the page to show up. I did a suspense on the layout, and I saw the fallback for 5 to 6 seconds.
The components are fairly simple and the fetch takes 100ms to complete, I have no idea what it could be, by watching the browser profiler, I see a 5-second Idle.
This happens every time I refresh the page.
21 Replies
Netherland DwarfOP
This is the page in question
try removing that fetch call
to confirm it's not the network request
being slow
or time it
and consider caching it so it's not being fetched on each nav
Netherland DwarfOP
I am timming the network request time and its between 100 and 200ms. (removed the code from the screenshot), If i remove all components and just return a div the page loads instantly
also tried to see if was any of those components making the delay, but its indifferent having one or all 4, it takes 6 seconds every time
Ah yeah there’s a limitation on cache size unfortunately
Netherland DwarfOP
I still dont understand on why making the prop to the child component smaller makes such a difference in the load times, need some help, because in my home page I have a huge list that takes 12 seconds to show on screen.
I tried Remix and as soon as I press refresh the list shows up... takes less than 1 second. I assume the problem is RSC?
Even if I anotate use-client on the component still takes the same time.
I tried Remix and as soon as I press refresh the list shows up... takes less than 1 second. I assume the problem is RSC?
Even if I anotate use-client on the component still takes the same time.
Netherland DwarfOP
anyone?
I can provide all code, code snippets, etc
Netherland DwarfOP
bump
Netherland DwarfOP
please
Common House-Martin
why dont you make it client side
fetch it using axios and stuff
Netherland DwarfOP
I need SSR
for SEO
Remix returns the full html doc in 1.2 seconds, I don't understand the big difference to Next/RSC, I must be doing something wrong.
@Ray show the code
Netherland DwarfOP
You can find the discussion here with a repo: https://github.com/vercel/next.js/discussions/64225