From 9d7bca80de3ebd3e27e91afa541af804345aecc6 Mon Sep 17 00:00:00 2001 From: Yann MAHE Date: Fri, 14 Nov 2025 09:53:27 -0500 Subject: [PATCH] Warm up Next.js routes after dev server starts Add a curl request to / after the dev server is ready to pre-compile the main application routes. This triggers Next.js compilation on first access during setup rather than on first user interaction, significantly improving the initial user experience by avoiding 5-10 second compilation delays. The warm-up is non-blocking - if it fails or times out, the setup continues successfully and routes will compile on first user access as before. --- niteshift-setup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/niteshift-setup.sh b/niteshift-setup.sh index 9935f91e..495854aa 100755 --- a/niteshift-setup.sh +++ b/niteshift-setup.sh @@ -179,6 +179,14 @@ while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do sleep 1 done +# 8. Warm up the main application routes +log "Warming up main application routes..." +if curl -s -o /dev/null --max-time 30 http://localhost:3001/ 2>/dev/null; then + log "✓ Main routes pre-compiled" +else + log "Warning: Route warm-up timed out or failed (non-critical)" +fi + log "" log "================================================================" log "Setup complete! Umami dev server is running on http://localhost:3001"