#Next js app router loads page after 2-3 seconds of clicking

21 messages · Page 1 of 1 (latest)

latent laurel
#

I'm using next js app router
Where my page is async

export default async Page() {
  const data = await fetchMyPageData()
}

Here at the top the the page I'm making some request 2-3 request that give me some dafa and I pass it down the server components

Some of the components require same data

prime ermineBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

indigo pasture
#

Are you in dev mode? Its probably just taking a second to build the page.

#

If you navigate away and back to the page is it quick then?

primal finch
#

yeah its dev mode

#

surely

#

@latent laurel try doing the same thing after you run npm build or yarn build or pnpm build

#

whatever you use to run ur project

latent laurel
latent laurel
#

Maybe I'm fetching like 3 request at the starting of the page

indigo pasture
#

Are you available to troubleshoot now? I don’t wanna start trying to help and not get responses lol no shade serious question

latent laurel
#

It's off today here, I'll troubleshooting it in a while

Will post if I find anything, got a reddit post regarding this

There the post author did something with revalidate

indigo pasture
#

You should had a suspense boundary to see if it’s legit just taking that long to load the data

#

Errr loading.tsx

latent laurel
#

Yes correct

#

Will add them

latent laurel
#

ok so i shifted the request that i had at the beginning of the page tp thier individual component
all these components are async rsc
i attached suspense also outside these rsc

and a loading.tsx right next to this page

i open some other page in new tab and then i use Link to navigate to this page where the slow loading issue is than

i still see 3-4 seconds loading page then my suspense loadings

what i was expecting was a my suspense boundary to trigger (it should send a shell aka teh fallback)

and everyuthing should be very quick but it was not

#

the main issue is

navigating to this page takes 4-5 seconds
even after the above changes

latent laurel