Lesson 2 of 2

Caching

Compare the path of a cache hit with the longer path of a cache miss.

Architecture Step 1 of 3
Client App Cache Database

Look in the cache

The application receives a request and checks the cache for its key before reading the database.

What a cache changes

An application can keep recently used results in a fast store. When it already has the requested value, it can return the result without going to the database. That is a cache hit.

When the key is absent or expired, the application has to read the database. It can then save the result in the cache for a later request. That is a cache miss.

Check your understanding

Why might the second request for the same key take a shorter path? The first request can populate the cache, which gives the application a faster place to look the next time.