I'm having trouble when calling an API endpoint that's hosted in another server. For a reason I still didn't figured out, when calling endpoints in api.rheconsultora.com from the server (i.e. no Client Side Rendering) I sometimes (more often than not) get a timeout error stating that the endpoint delayed more than 10s to respond. The endpoint I can guarantee works properly and is completly open access (no credentials nor cookies required). I've already talked with my hosting provider on which the API is hosted, and they told me to inquiry Vercel to know the IP addresses that are being used to call the endpoint. Because, as far as I know, Vercel uses dynamic addresses and that may (this is not for sure) be being blocked by the firewall on the cPanel. I don't discard that the issue may be related to my code, so I have no issue in sharing it. That said, on localhost the project works properly and nothing times out. For now I've patched the solution by limiting the request to 3s, but this isn't optimal as it greatly harms my Google crawl SEO on my structured data.
I’ve run into a similar situation. Inside the API router, when I use fetch to call other endpoints, the request times out after 10 seconds, even though I’ve set the router’s maxDuration to 60.
Hi, glad for your help. When I fetch this API directly in the browser, without going through the API router, the request succeeds after 22 seconds. So it’s probably not an issue with the API provider.