NextJS app pretty slow

Hello ppl, i have a website deployed on vercel and it is pretty slow, loading a page takes 7 secs, any tips or ideas why it is taking so long? i dont think (hope) that that is because of cold starts
No description
22 Replies
Balduin
Balduin10mo ago
also the Document is <6KB
Neto
Neto10mo ago
are you running ssr?
Balduin
Balduin10mo ago
yeah for generating an csrf token also page reloading takes like ~1sec
Neto
Neto10mo ago
can you share the link?
Balduin
Balduin10mo ago
admin.nessy.app sorry for late answer and my.nessy.app
Neto
Neto10mo ago
i accessed the site and had no issues related to slow down also not the link with the url from the image you can try to create a static page or a isr page to see if things are still slow but ssr is a pain in most ways
Christoph
Christoph10mo ago
Is it always the first request after ~10-15min? my.nessy.app was slow for me. But only the first request.
Neto
Neto10mo ago
then its the coldstart + ssr if you are using prisma, then its even worse
Neto
Neto10mo ago
Theo - t3․gg
YouTube
That's It, I'm Done With Serverless*
Gonna be a long year of moving everything to the edge... ALL MY VIDEOS ARE POSTED EARLY ON PATREON https://www.patreon.com/t3dotgg Everything else (Twitch, Twitter, Discord & my blog): https://t3.gg/links S/O Ph4seOne for the awesome edit 🙏
Balduin
Balduin10mo ago
not possible, it is not getting data on the server side. We are using an REST API. ONLY the csrf token is generated on that server. we only fetch data on the client we are realy not doing much, cant be that hard to generate a csrf token from a string
Neto
Neto10mo ago
are you using prisma?
Balduin
Balduin10mo ago
there is no db calls on that server its just a front end, that gets data from the REST Api on the Client side. the csrf token only generates a string from a strong
Neto
Neto10mo ago
colds starts are a pain
Balduin
Balduin10mo ago
that SUCKS holy
Neto
Neto10mo ago
No description
Balduin
Balduin10mo ago
that is close to unusable with bad internet
Neto
Neto10mo ago
nextjs + serverless you can try using something to keep the lambda warm but yeah nextjs is a boat on a first cold start
Balduin
Balduin10mo ago
oven? i mean i guess it is maybe we screw the csrf token lol
Neto
Neto10mo ago
lmao fair
Balduin
Balduin10mo ago
then there whould be no ssr
Neto
Neto10mo ago
avoid sst when you can are you using pages dir or app router?
Balduin
Balduin10mo ago
Pages but who else can I get a card token? using a cookie with htmlOnly and sameSide strict, I heared once, that you don’t need an csrf T then. Not shure doe
Want results from more Discord servers?
Add your server
More Posts