NextAuth slows the app.
Unanswered
ekimcem posted this in #help-forum
ekimcemOP
I have an application which is deployed at https://app.globalturkish.org,
It takes like 15-20 seconds website to be opened, how can i improve this ? It was deployeed to Vercel and i changed it to AWS Amplify to see if there is any improvements but i couldnt figure it out
It takes like 15-20 seconds website to be opened, how can i improve this ? It was deployeed to Vercel and i changed it to AWS Amplify to see if there is any improvements but i couldnt figure it out
9 Replies
How do you use NextAuth in your app? Generally with JWT token & auth middleware, the load speed would not be affected
ekimcemOP
I am using JWT, not any other providers
I need more information about how you are handling auth, a reproducible example, GitHub repo or CodeSandbox is appreciated.
Are you using getSession or getServerSession?
You’re likely experiencing a cold start on vercel
Make sure you’re using getServerSession to avoid the extra lambda calls
A cold start will always exist on vercel, so it’s a matter of how well you optimize the size of your functions.
But using getServerSession should definitely help
@linesofcode Are you using getSession or getServerSession?
ekimcemOP
thank you so much for the info. i am handling the session with provider, not using both of them. taking the session with useSession hook from client side.
Anyways i will try this ðŸ‘
Anyways i will try this ðŸ‘