Caching hard
How do Edge Workers enable 'Cacheable Personalization'?
- A Personalization and caching are fundamentally incompatible, as every user requires a unique server-side render of the requested resource.
- B By caching a generic HTML skeleton at the edge and using server-side logic at the PoP to inject user-specific data into the response buffer.
- C By utilizing encrypted browser cookies that allow the CDN to perform a localized state lookup without communicating with the primary origin server.
- D By leveraging a DNS-level routing strategy that directs every unique user ID to a geographically isolated CDN node dedicated to their specific profile.
Answer: B. By caching a generic HTML skeleton at the edge and using server-side logic at the PoP to inject user-specific data into the response buffer.
**Edge Side Includes (ESI)** or modern **Edge Computing** (e.g., Cloudflare Workers, Lambda@Edge) allows you to cache the heavy, static parts of a page (Template) at the CDN edge while fetching dynamic, user-specific data (Personalization) from a lightweight API call. The edge worker 'stitches' these together, delivering a fast, personalized page without hitting the origin for the full HTML.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- In the Cache-Aside pattern, what happens when the application requests data that is missing from the cache (a 'Cache Miss')?
- Why use a centralized Distributed Cache (like a Redis Cluster) over local in-memory caches on each web server?
- Setting a short TTL (e.g., 60 seconds) on a cached object helps to:
- What is the primary architectural goal of introducing a cache into a system?
- Most caching systems rely on the principle of 'Temporal Locality', which states:
- Your cache uses an LRU (Least Recently Used) eviction policy. When the cache is full, which item is removed?