#How to load pages faster

14 messages · Page 1 of 1 (latest)

pseudo totem
#

On my production and local environment, whenever I click switch details theres a few seconds where nothing happens, then it routes to the switch page. I'm not very sure why its so slow.

dense tundraBOT
#

🔎 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)

pseudo totem
#

picture of home page

#

home page - gets the first 10 switches from the database and maps them out to switchCard

#

Switch card, takes the data and renders the switch card. the link at the bottom is what's slow

#

/switches/switch page, gets the switch from params and finds the switch in the db, passes it onto the client side component

#

the client side component, renders final picture see below *

#

final picture

tardy gull
#

The db is probably the bottleneck. I doubt it would make that much of a difference, but you could try switching off of prisma.

#

Also you’re not suspense-ing right. You have to wrap the component that’s making the async calls in a suspense for it to trigger. So that would make the page load faster with spinners.

pseudo totem
#

thank you!!

#

this makes it sooo much better and faster

#

I didnt know thats how you're supposed to do it