Try
↑ ↓ move↵ openesc close

Interview prep / CDNs and edge caching

Junior · CDNs and edge caching · System design interview question

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

Learn it by running it

The cdns and edge caching lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms