Skip to content

Mobile API Communication — Caching, Optimistic Updates

React Query patterns for mobile, optimistic UI, background refresh, and handling flaky connections

15 min readmobile, api, caching, optimistic-updates, react-query

API communication on mobile has constraints that web developers rarely think about. Cellular connections drop without warning. Users switch between Wi-Fi and cellular mid-request. Background apps get killed by the OS, interrupting ongoing syncs. Every API call is more expensive — slower, less reliable, and draining battery.

The mobile apps that feel fast aren't the ones with the fastest APIs. They're the ones that hide latency through smart caching, optimistic updates, and background refresh. This lesson covers the patterns that make your app feel instant even on a 3G connection.

The Latency Problem

A typical API call on mobile:

DNS lookup:         50-200ms
TCP handshake:      50-200ms
TLS handshake:      100-300ms
Request transfer:   50-100ms
Server processing:  50-500ms
R

This lesson is part of the Guild Member curriculum. Plans start at $29/mo.