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