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
BalduinOP17mo ago
also the Document is <6KB
Neto
Neto17mo ago
are you running ssr?
Balduin
BalduinOP17mo ago
yeah for generating an csrf token also page reloading takes like ~1sec
Neto
Neto17mo ago
can you share the link?
Balduin
BalduinOP17mo ago
admin.nessy.app sorry for late answer and my.nessy.app
Neto
Neto17mo 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
Christoph17mo ago
Is it always the first request after ~10-15min? my.nessy.app was slow for me. But only the first request.
Neto
Neto17mo ago
then its the coldstart + ssr if you are using prisma, then its even worse
Neto
Neto17mo 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
BalduinOP17mo 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
Neto17mo ago
are you using prisma?
Balduin
BalduinOP17mo 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
Neto17mo ago
colds starts are a pain
Balduin
BalduinOP17mo ago
that SUCKS holy
Neto
Neto17mo ago
No description
Balduin
BalduinOP17mo ago
that is close to unusable with bad internet
Neto
Neto17mo 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
BalduinOP17mo ago
oven? i mean i guess it is maybe we screw the csrf token lol
Neto
Neto17mo ago
lmao fair
Balduin
BalduinOP17mo ago
then there whould be no ssr
Neto
Neto17mo ago
avoid sst when you can are you using pages dir or app router?
Balduin
BalduinOP17mo 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