TTL (Time-To-Live) automatically expires cache entries after a fixed duration. It is the simplest invalidation strategy.
Configuration:
- Short TTL (- min): Frequently changing data
- Medium TTL (- min): Semi-stable data
- Long TTL (- hours): Rarely changing data
You accept bounded staleness in exchange for simplicity. The data might be stale, but never older than the TTL. This works well when perfect consistency is not required.