Caching
ETags: multiple-choice review
Six questions that cut across the whole unit. Each one mirrors a call you make in a real caching review — not a header to recite, but a tradeoff to weigh when bandwidth, latency, and consistency pull against each other.
Confirm you can connect what a 304 saves, how the conditional-request handshake works, strong vs weak validators, ETag vs Last-Modified, and the per-node failure that silently kills revalidation behind a load balancer.
A dashboard polls an 8 KB JSON config every 30s over an 80 ms RTT link. You add ETags and every unchanged poll now returns 304. What did you actually buy?
You scaled an API from 1 to 3 pods behind a round-robin load balancer, and revalidation stopped returning 304s — every poll is a clean 200. What is the most likely root cause?
A client sends If-None-Match with the strong tag "a3f5c901" and the server's current validator is the weak form W/"a3f5c901". Does the server return 304, and why?
When does the strong-vs-weak distinction actually change behaviour, rather than being cosmetic?
A high-write config row can change several times within the same second. A teammate proposes Last-Modified / If-Modified-Since because it is cheaper than hashing. What is the risk, and what is the precise validator?
A proxy starts gzip-compressing responses on the fly between two deploys, and previously-cached strong validators begin behaving incorrectly. Why?
The unit’s through-line is one sentence applied five ways: a 304 saves the body bytes, never the round-trip. Revalidation is a versioning handshake — fingerprint, echo, compare — and it only works when the ETag is a pure function of the content, so every node agrees. Strong validators promise byte identity (mandatory for range requests); weak ones promise semantic equivalence, and If-None-Match compares weakly anyway, so the distinction mostly bites on resumed downloads. ETags beat Last-Modified on precision because timestamps have a one-second blind spot. And the failures — per-node tokens, mtime drift, compression changing the bytes — all resolve back to the same rule: keep the ETag content-derived.