backendsystem-design
TTL and LRU solve different cache problems
Anonymous
TTL limits how long an entry remains valid. LRU evicts a least-recently-used entry when a capacity limit is reached. One handles age; the other handles space. A cache can use both, but expiry and capacity eviction need separate policies.
0