Reduce Redundant Frontend Requests for Availability and Pricing
Context
You are designing the web client and APIs for a bookings marketplace that displays many listings (e.g., 50–200 on search results, plus a detail page). The client repeatedly needs availability and pricing for a user-specified date range and party size. Today it often fires many small, overlapping requests, increasing latency and backend load.
Task
Propose how to reduce redundant frontend network requests specifically for availability and pricing. Compare the following approaches, provide an example API schema or query, discuss trade-offs, and outline safe monitoring and rollout:
-
Batching endpoints (REST-style)
-
GraphQL
-
Request coalescing/deduplication (client and/or server)
-
HTTP/2 multiplexing
-
Client-side caching with well-defined cache keys and TTLs
-
Pagination/windowing of work (e.g., viewport-first)
Include:
-
An example API schema or query (REST batch and/or GraphQL).
-
Trade-offs across latency, payload size, cacheability, and observability.
-
How you would instrument, monitor, and roll out the change safely.