Request Coalescing
Request coalescing, also called request collapsing, is a caching technique where many simultaneous requests for the same uncached resource are combined into a single upstream request. The first request fetches from the origin while the others wait and receive the same response.
Technical Architecture & Deep-Dive
When a popular cache entry expires, hundreds of clients may request it at the same moment. Without coalescing, all of them hit the origin at once, a thundering herd that can overload servers or exhaust third-party rate limits.
Coalescing ensures only one fetch per key is in flight. Combined with stale-while-revalidate, clients keep receiving the stale copy while a single background request refreshes the cache.
Key Architectural Benefits
Implement Request Coalescing at the Edge
Deploy lightweight API aggregation, edge caching, and secret injection in minutes without Docker containers or complex servers.
Frequently Asked Questions
Q:Does request coalescing work for POST requests?
Generally no. Coalescing is applied to cacheable, idempotent GET requests where every waiting client should receive the same response.
Related Architecture Concepts
Stale-While-Revalidate (SWR) is an HTTP cache control extension that instructs the edge to serve an existing cached (stale) response instantly to the client, while asynchronously initiating a background fetch to refresh the cache. Users experience zero latency wait time while always receiving fresh data.
Tiered caching is a CDN architecture where edge locations check a regional upper-tier cache before contacting the origin. When one edge misses, the upper tier may already hold the response from another edge, dramatically reducing requests that reach the origin server or upstream API.
API Rate Limiting is a traffic control mechanism that caps the number of requests a client, IP address, or API token can execute within a specified time window. Rate limiting prevents server overloading, protects against credential brute-forcing, and shields upstream APIs from exceeding subscription quotas.
Ready-to-Use Edge Recipes
REST API rate limits hit fast from Frontend / Web. Cache 300s on GET calls where the query string scopes the response.
Edge absorbs repeated profile lookups across users. For "firebase api rate limit avoid with edge caching", store FIREBASE_ACCESS_TOKEN in Secret Vault, call https://firestore.googleapis.com/v1/projects/{{query.projectId}}/databases/(default)/documents/{{query.collection}}/{{query.docId}} from a Worker, and let FlutterFlow hit only https://realcomposer.com/v1/workspace/avoid-firebase-api-rate-limits-edge with an rc_live_ client token. Enable 180s GET cache only when query params identify the resource.