Next.js Discord

Discord Forum

Slow page loading

Unanswered
Jumbo flying squid posted this in #help-forum
Open in Discord
Jumbo flying squidOP
Hey all.

Our production build has long (>3s) content download times on all routes. These pages have minimal data so I'd expect them to load in <1s. Sometimes navigating between pages has their content download take 5ms. What could be causing such dramatic times?



We are:
- Using app router
- on Next 15.1.4

Thanks!

87 Replies

Jumbo flying squidOP
Yeah let me grab the build logs. Our prod is deployed at: app.valleyconnect.app. You’ll need to sign in and swap between tabs on the side. Each one of these are there own route
Doesn’t matter if you pick creator or brand on sign up
Here’s the build logs via paste bin: https://pastebin.com/sQiH9Hs4
@Dutch
and as a ss if possible, its colored because
Jumbo flying squidOP
here is running next dev
@Jumbo flying squid here is running next dev
Dutch
i need next build
Jumbo flying squidOP
we tested removing our cookie call in our root layout to not force dynamic rendering but that didnt seem to fix the long content download times
I also ran the bundle analyzer on the prod build and didnt see anything crazy
Dutch
we need to check your network requests
and you have 80kb middleware
Jumbo flying squidOP
this is one example of loading a new route
Dutch
can you share a live share link
Jumbo flying squidOP
is that different than just what our prod link is?
Dutch
yep go vscode and f1 > start collab...
Jumbo flying squidOP
uh sec, dont think I have that vscode extension.
Dutch
okay waiting 🙂
Dutch
can you give me terminal access
Jumbo flying squidOP
need to run something?
Dutch
yep to see logs
Jumbo flying squidOP
aight, how do i get accss to that
Dutch
start a shared terminal
Jumbo flying squidOP
its on go for it
we do run some auth in our middleware, but surely that can't be nuking perf that much
or at least we do via trpc
not sure it will work via share since the localhost isnt pointed towards my local db
Jumbo flying squidOP
Dutch
can you click on campaigns
god i hate remote collab 😄
Jumbo flying squidOP
yep
lol sorry!
do you want the full view, just fetches, or the har?
Dutch
full
i meant click on campains on network tab 😄
Jumbo flying squidOP
ha sec
i think the page loads -> runs the db calls -> then finishes loading is what it seems like based on the timing of requests finishing
Dutch
i need response 😂
you should have been fixed it so far lol
basically it says some of your components taking too much to render cuz of something it depends
Jumbo flying squidOP
what points to that in the network tab? Just curious so i can learn
it seems likely that the db calls we make in our server components are taking too long to finish?
Dutch
instead timing click on response
Jumbo flying squidOP
just says "failed to load response data"
Jumbo flying squidOP
thats just returning the html page. want me to paste that into pastebin
Dutch
yep pls
cuz it shouldnt take 4 sec to render
Jumbo flying squidOP
Dutch
either your UI library has heavy components
Jumbo flying squidOP
yeah we are using mantine so i wonder if the bundle is killing it? Although bundle analyzer had it within reason
i did find this so i could try with that https://mantine.dev/guides/next/#app-router-tree-shaking
furthermore it looks like any component i use from this ui defaults to use client
Dutch
weird one, it shows a lot large page
but at project there is only around 100 lines
Jumbo flying squidOP
if im understanding those links above. Anywhere I use a mantine component, its defaulting to be client side loaded. So these pages are getting fully fetched client side which would explain long load times
although this makes it seem like not an issue https://github.com/orgs/mantinedev/discussions/5414
had to end session, plane is boarding
Dutch
i need this 😄
i need to go too
lets review this when you have more time
check that summary tab and tell me which stage took longest
Jumbo flying squidOP
Yep sounds good. I’ll pm you. Thank for the help so far dude
Sent you a friend request
Crucian carp
@Jumbo flying squid Hey I have a question

I got a project on next js 14 and I just upgade to 15 latest

route navigation is slower than 14 version
before when build and start so in prod change route is like immediately
now its like 1sec
even if I click like between /dashboard and /products

and I do like come and go between this 2 route
it's not immediately
Jumbo flying squidOP
@Crucian carp seems to be a similar problem. Fetching new routes takes far too much time. I’ll update here if I find a solution
@Crucian carp I find it
Jumbo flying squidOP
Sorry what did you find?