Next.js Discord

Discord Forum

API Route Cold Start Issue

Unanswered
Black Oystercatcher posted this in #help-forum
Open in Discord
Black OystercatcherOP
One of my API calls handles some overhead in the route.ts file itself outside the main POST function. However in my app the file doesn't compile until the first time the API is used so I'm facing a cold start issue where latency really matters for me. What config do I adjust in Next.js (using the router archetecture) to make a specific route pre-compile when the site is visited opposed to when the api is actually needed a few seconds later?

0 Replies