Apex › Transport & web
Service Worker caching strategies
How a web app works offline and loads instantly. A Service Worker intercepts every fetch and answers by a policy you choose, trading off freshness, speed, and availability: cache-first (fast + offline, maybe stale), network-first (fresh, falls back offline), stale-while-revalidate (serve the cached copy now, refresh in the background), network-only, cache-only. Pick a strategy and toggle the network up/down and whether a copy is cached, and watch which source answers, whether it’s fast and fresh, and whether it revalidates — network-only offline breaks, cache-first serves stale, SWR does both.
More in Transport & web
- TCP handshake
- TIME_WAIT & ports
- TCP Fast Open
- 0-RTT resumption & replay
- TCP congestion
- TCP CUBIC
- TCP BBR
- Flow control
- Silly window syndrome
- TCP SACK
- ARQ (GBN vs SR)
- RTO & Karn
- Bandwidth-Delay Product
- M/M/1 queueing
- Bufferbloat
- ECN marking
- QoS scheduling
- H2/QUIC flow control
- HTTP/2 multiplexing
- QUIC vs TCP
- QUIC connection migration
- HTTP/3 & QPACK
- gRPC & protobuf
- WebSocket
- Realtime: SSE vs WS
- SCTP multi-homing
- Multipath TCP
- CDN & caching
- Conditional & range
- Rate limiting
- Leaky bucket
- GCRA (virtual scheduling)
- Retry & circuit breaker