Answer
- The app looks up the key in the cache.
- On a hit, it returns the value.
- On a miss, it reads the database, writes the value into the cache (with a TTL) and returns it.
The cache holds only what was asked for, and the app owns all the logic.
Caching · Flashcard
The cache holds only what was asked for, and the app owns all the logic.