React Native + Cloudflare Workers: requests freeze after 1–2 mind idle
07:54 16 Nov 2025

React Native + Cloudflare Workers: requests to *.workers.dev freze/hang after 1–2 minutes idle, while direct origin requests still work

Hi everyone,

I’m seeing a very strange issue with a mobile app that talks to a Cloudflare Worker, and I’d really appreciate any insights or known workarounds.

Environment / Setup

Client: React Native (Expo) app

-Uses both the built-in fetch and Axios (same behavior with both)
-Runs on Android (and likely iOS as well later)

API layer: single Cloudflare Worker

Worker role: simple proxy / aggregator for multiple upstreams:

- OpenRouteService (directions, foot-walking GeoJSON)
- Other map/tile relatedfetches

Worker behavior:
No WebSockets, no streaming.
Just regular fetch() calls to upstream APIs and returning JSON / proxied binary.

Client-side request orchestration:
I have a GLOBAL_FETCH_QUEUE in JS (React Native) to:

- limit concurrency (typical max 3 active),

- wrap each request in an AbortController with a per-request timeout:

- 10s for critical calls (routing, reverse geo),

- 20s for background/“important” calls (POI fetch, wiki, AI story).

The queue logs everything: enqueue, start, timeout, etc.

The Core Symptom

What works

Initially, everything works perfectly:

- Routing via the Worker: GET /api/directions?... → 200 OK, ~200–300ms
- POI fetch: /api/pmtiles-multi?... → 200 OK
- Reverse geocoding: /api/revgeo?... → 200 OK
- Other requests --> 200 OK

If I call OpenRouteService directly from the app (bypassing the Worker), e.g.:https://api.openrouteservice.org/v2/directions/foot-walking/geojson using fetch from React Native, it always works and returns quickly.

When it breaks

The issue appears after the app is idle for ~1–2 minutes, no network activity from the app in that time.

Client (React Native) logs:

Axios: ERR_NETWORK, no HTTP status, ~10s (my timeout).

Or global fetch queue logs: ⏱️ TIMEOUT (10000ms) ... was_aborted: true

Worker logs for that same URL show something like:[WORKER_DIRECTIONS_REQ] ... method: GET [ORS_ROUTING] Fetch completed ... status: 200, duration_ms: ~200 [WORKER_DIRECTIONS_RES] status: 200, cached: false So it looks like the request reached the Worker, upstream ORS call succeeded, and the Worker responded with 200, but the client never got the response before my own 10s timeout.

Case B - (now, with direct ORS debug but i want it to use worker!!): I temporarily routed only the directions call directly to ORS (bypassing the Worker):

First POI + route via direct ORS → SUCCESS.
Wait 1–2 minutes.
New POI + new route via direct ORS → SUCCESS again (so the device’s network is fine).

Immediately after arrival at that new POI, the app triggers several Worker-based fetches (POI top-up, wiki, revgeo, etc.), and those Worker calls now start timing out with my 10–20s client-side timeout:

POI fetch /api/pmtiles-multi?... → times out at 20s.

Wiki /api/poi/wiki-card?… → times out at 20s.

Reverse geo /api/revgeo?... → times out at 10s.

Sometimes MapLibre glyph loads (proxied via Worker) also log timeouts.

So at this point, it looks like:

Direct https://api.openrouteservice.org/... calls continue to work, even right after a long idle.

All worker proxy calls start to hang/timeout from the React Native side after 1–2 minutes of idle.

In some earlier logs, the Worker reported those requests as 200 OK while the client saw a timeout/error.

This makes me feel that:

The problem is not my upstream services and not the general device/network connectivity, but something about the connection / session between a React Native app and *.workers.dev after an idle period.

How do you guys would handle it? I feel like i tried a lot of things.

react-native proxy cloudflare http-proxy cloudflare-workers