A cache hit occurs when a lookup finds the requested value under its cache key. The application returns that value directly, avoiding the backing store and its slower lookup or computation. section 6.2
A cache hit is the fast path in cache-aside caching:
- The application looks up a cache key. section 6.3.1
- If the key exists and has not expired, the cache returns the value. section 6.3.1
- If the key is absent or expired, the application queries the backing store, transforms the result, and updates the cache. section 6.3.1
- Measure effectiveness with the cache hit-to-miss ratio; a low hit ratio can leave caching overhead without enough latency reduction. section 6.2
User lookup
An application uses a user ID as the cache key. On a hit, it returns the cached user information. On a miss, it reads the database, converts the result to JSON, and stores it under that user ID for later requests. section 6.3.1
Figure 6.1 With cache-aside caching, the client first looks up a key from the cache. On a cache miss, the client queries the database and updates the cache.
The request path makes the hit fast path and the miss path explicit: cache lookup first, followed by database retrieval and cache update only on a miss. section 6.3.1


