Caching, CDN and real-time delivery

The cardinal rule to say out loud before anything else in this area: cache invalidation bugs are consistency bugs, so choose the staleness you can tolerate before you choose a cache. Most candidates answer caching questions by naming Redis. The lead-level answer layers it: browser, CDN, gateway, in-process, distributed, database buffer pool, and picks the layer that matches the invalidation story.

The real-time half of the chapter is where LLM products live now. Token streaming made server-sent events relevant again, and the reasons why are a clean, checkable test of whether someone understands HTTP infrastructure.

What this chapter covers

Source: §18.