All Questions
Api Design medium

A client fetches /products/123 and receives ETag: 'abc123'. How does the client use this for conditional caching?

  1. A Send the If-None-Match header with the last seen ETag value; the server then validates the version and returns a 304 Not Modified if the data is identical.
  2. B Cache the ETag value in the browser's local storage and append it as a query parameter in every subsequent request to ensure the server skips data rendering.
  3. C Use the ETag as a unique transaction identifier in the request body to prevent duplicate submissions and ensure strictly atomic rate limiting operations.
  4. D Provide the ETag in a custom X-Cache-Key header so that intermediate CDN nodes can bypass the origin server and serve the response from the edge.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions