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