Caching · Flashcard

What do you trade when you choose a cache TTL?

easy

Answer

A short TTL keeps data fresh but causes more misses and database load. A long TTL gives a high hit rate but serves stale data for longer after a change. Pick it from how stale each kind of data may be, and add random jitter so keys written together do not all expire together.

Review this in your daily deck All cards in Caching