🔹 What is a Cache?

A cache is a temporary storage that holds frequently accessed data so it can be retrieved faster the next time it’s needed.

Example: When you open a website, your browser may cache the images or styles so the next visit is faster.


🔹 What is a Cache Miss?

A cache miss occurs when the requested data is not found in the cache.

Instead of serving it quickly from memory, the system must:

  1. Go to the slower backend storage (e.g., database, disk, or server)

  2. Fetch the data

  3. Optionally store it in cache for next time (called cache population)


🔹 Types of Cache Misses:

TypeDescription
Compulsory MissFirst-time access — cache has never seen the data
Capacity MissCache is too small to hold all data; older data gets evicted
Conflict MissMultiple data items map to the same cache location (in direct-mapped caches)

🔹 Analogy:

Think of your refrigerator (cache).
You go to get milk (data), but it’s not there → cache miss.
So you go to the store (main memory/database), get milk, and put it in the fridge.


🔹 What Happens During a Cache Miss?

  1. Check cache → Miss

  2. Fetch data from main storage (DB, file system, API, etc.)

  3. Optionally cache the data for future requests

  4. Return data to requester (user, app, etc.)


🔹 Why Cache Misses Matter:

  • Increases latency

  • Increases load on the backend

  • Affects system performance and scalability

That’s why cache hit ratio (hits / total requests) is a key metric.