Glossary coding Term Page
TTL (Time To Live)
Expiration timer that defines how long cached data stays trustworthy.
Core Idea
TTL values count down per cache entry. When the timer reaches zero, the entry is evicted or marked stale so the system recomputes it. Choosing a TTL balances freshness vs. the savings gained from repeated reuse.
Why It Matters Here
FastAPI examples store serialized responses in a Redis cache with a specific TTL to keep data synchronized. Monitoring TTL expiry alongside cache hits explains why long expirations risk stale results while short ones erase the benefits of caching.