Top 3 Http caching Interview Questions
Browse 3 real-world technical and behavioral interview questions about Http caching. Review scenarios, edge cases, and architectural best practices.
Your origin is in one region and readers are worldwide. What do you cache, and what happens the moment you must invalidate it?
CDN caching for global reads works when cacheable bytes are separated from personalised fragments. Use content-addressed assets, tag-based purges for pages that must change, and plan for purge storms because invalidation sends cold traffic back to the one origin region. It also connects http caching to the point an interviewer is testing.
What goes into a cache key, and what happens when two requests that should get different responses collide on one?
The key must contain every request input that changes the response — identity, scope, locale, device class, active flags — because anything left out silently merges two different responses into one entry. An unkeyed input is both a correctness bug and an injection surface.
Where do you put the cache, and how big does it need to be?
Choose the layer by who else can reuse the same bytes and how tolerable staleness is that far from the user, then size it from the working set rather than the dataset. Watch the miss rate, not the hit rate: origin load is proportional to misses, so 99 percent falling to 95 is a fivefold traffic increase.