What does the TTL on a cached response trade off?
Sketch your own answer first, then compare it with the one below.
A strong answer
It trades origin load against freshness. A longer TTL means a copy serves more requests before it expires, so the origin does less work. It also means the copy can outlive a change at the origin, and users see old content.
A good answer gives a way to pick. Content that never changes, such as a versioned script, can have a very long TTL. A page that changes often needs a short TTL, a purge, or both.
Sources
- Roy Fielding, Mark Nottingham, Julian Reschke (2022). RFC 9111: HTTP Caching.