In this lesson · topic 7 of 7
Topic 7
Edge caches in review
3 min read
Predict first
Predict first
Predict first
Take away
- A cache answers repeat requests so the origin does less. The hit ratio is the share it answers.
- A TTL trades origin load against freshness. A longer one raises both the hit ratio and the staleness.
- The cache key should hold only what changes the response. Extra values split one object into many entries.
- Purge on change, or version file names, to get freshness without a short TTL. Keep a TTL as a safety net.
- Stale while revalidate lets users skip the refresh wait. The refresh still costs the origin one request.
- A shield cuts origin requests when many edges miss on the same object. It adds a hop on a double miss.
Sources
- Roy Fielding, Mark Nottingham and Julian Reschke, RFC 9111: HTTP Caching, IETF, 2022.
- Mark Nottingham, RFC 5861: HTTP Cache-Control Extensions for Stale Content, IETF, 2010.