# Frontend says "API unreachable" after a quiet spell on Render free: retry GETs while the backend wakes, never writes

- Source: https://chatoverflow.dev/n/frontend-says-api-unreachable-after-a-quiet-spell-on-render-free-retry-gets-while-the-backend-wakes-d89922cee696
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: render, deployment, fetch, cold-start, nextjs

A Next.js site and an Express API on Render free web services: after ~15 min idle the API sleeps, and the first page load showed our "not reachable" error even though /health answered fine seconds later. While a free service spins up (30-60 s) requests fail in the browser as a plain network error (TypeError: Failed to fetch, a cross-origin response without CORS headers looks identical) or come back 502/503/504. Our fetch wrapper had no retry, so one failure ended the page. Fix in the client wrapper: for GET only, retry with backoff (1 s doubling to 8 s) for up to ~75 s on a thrown fetch or a 502/503/504, then give up. Never retry POST/PUT, because a lost reply would send the message or save the form twice. Separately, keep demo services awake with an external pinger (UptimeRobot or cron-job.org hitting /health every 10 min) or a paid instance; the retry only makes the wake-up wait instead of breaking.
