Instant Purge and Surrogate Keys: Fastly's Answer to 'TTL of 0 or Wait an Hour'
How Fastly surrogate keys tag cache objects so a CMS publish can purge a graph of pages in seconds instead of waiting out a long TTL.
Tag
15 articles · 54 min of reading
How Fastly surrogate keys tag cache objects so a CMS publish can purge a graph of pages in seconds instead of waiting out a long TTL.
Cache-aside with RedisTemplate and @Cacheable: serialization, stampede locks, negative caching, and when the annotation hides a thundering herd.
What 'hit' means, why query strings and cookies destroy it, and how to design cache keys, TTLs, and origin shields on purpose.
Cache-aside, read-through, write-through, write-behind — when each pattern fits, and the invalidation trade-offs nobody escapes.
How Cache-Control directives and ETags interact with browser and CDN caches, and where each layer disagrees in ways that cause stale content bugs.
How semantic caching cuts LLM spend by reusing responses to meaningfully similar queries, and the correctness traps that come with it.
Practical TanStack Query patterns for query keys, cache invalidation, and optimistic updates that hold up in real React applications.
Behind Pinterest's sharded MySQL fleet sits a heavy memcache layer, and the real engineering challenge was never caching reads — it was invalidating them correctly.
Why generic memcache stopped fitting Facebook's social graph, and how TAO's objects-and-associations model became the read path for billions of requests.
How Twitter outgrew stock Memcached, built Twemcache and the Pelikan framework, and turned caching into deliberately owned infrastructure rather than a commodity.
How Netflix wrapped Memcached in EVCache for wide-area replication and built Dynomite to give Redis a Dynamo-style distributed backbone.
A tour of Redis's core data structures and the caching, rate-limiting, and leaderboard patterns each one is actually built for.
How Facebook turned a simple key-value cache into a cluster of thousands of memcached servers without drowning in stale reads and thundering herds.
The gap between what @Cacheable looks like it does and what it actually does, including key collisions, exception handling, and self-invocation.
Browser, CDN, application, and database caching each solve a different problem and fail differently — knowing which layer to reach for matters.