TTL is not a replacement policy; it’s an expiration rule that often coexists with an eviction policy.
Store `expires_at` per entry.
- -
Pros: no background work. Cons: expired entries can occupy space until touched.
Maintain an expiration index:
- -
Pros: can proactively free space. Cons: extra metadata and background/maintenance work.
When cache is full:
- -
-