Next.js Discord

Discord Forum

Slow api calls when in production

Unanswered
Dalmatian posted this in #help-forum
Open in Discord
DalmatianOP
hello I need a little help here, when i run my app with npm run dev all api calls to /api and from there to the external api are called in milliseconds, but when i deploy to my server or to a serverless service, they get slower and respond in like 14s any idea what should i check?

4 Replies

Palomino
It could be that your external api is close to you (during development) but is not close to the server that you deployed to
@Palomino It could be that your external api is close to you (during development) but is not close to the server that you deployed to
DalmatianOP
i dont think so im in mexico the api is on aws and i have the server there too in a different ec2 but same zone
Palomino
I'm not sure then
Toyger
can you provide some code of your api calls