mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 22:57:12 +01:00
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.
This commit is contained in:
parent
eb532d98c9
commit
9d7bca80de
1 changed files with 8 additions and 0 deletions
|
|
@ -179,6 +179,14 @@ while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
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 "================================================================"
|
log "================================================================"
|
||||||
log "Setup complete! Umami dev server is running on http://localhost:3001"
|
log "Setup complete! Umami dev server is running on http://localhost:3001"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue