slow initial request, then fast requests for 5 minutes
Answered
Golden-cheeked Warbler posted this in #help-forum
Golden-cheeked WarblerOP
I'm kind of new to using next and wonder why the initial request to a route handler takes significally longer than the requests after that. The requests are "normal" for 5 minutes after the last request. So If I wait 5 minutes without doing any request the times will be slow like the initial request once again.
The same issue occurs between page navigation, if I switch page the initial request it will take way long than "normal", and for 5 minutes after the last request all other page switches feels "normal".
Just wonder where in the docs I can read about the phenomena.
The same issue occurs between page navigation, if I switch page the initial request it will take way long than "normal", and for 5 minutes after the last request all other page switches feels "normal".
Just wonder where in the docs I can read about the phenomena.
7 Replies
American black bear
is this in dev mode or a prod build?
Golden-cheeked WarblerOP
prod build on vercel
website is https://scamsell.vercel.app
American black bear
could it just be serverless cold starts? https://vercel.com/guides/how-can-i-improve-serverless-function-lambda-cold-start-performance-on-vercel
Golden-cheeked WarblerOP
might be actually, ill see if doing anything from my phone affects it
edit: yeah, it was the cold start
edit: yeah, it was the cold start
American black bear
"5 minutes" seems to match your issue
Answer
Golden-cheeked WarblerOP
yeah, it's probobaly that. Thanks for the help!