How Computers Work Beginner

What Is Cache?

Cache is small, super-fast storage that keeps used data close so things load faster.

Part of the How Computers Work path ยท Step 4 of 12

Download the poster

Cache (pronounced "cash") is a small storage area that saves copies of data that's used often. It acts like a shortcut, so your device doesn't have to go all the way to the main storage every time.

Think of cache as a notebook where you write down answers you use a lot, so you don't have to look them up every time.

How does it work? When you request data, your device looks in the cache first. If it's there (a cache hit), it gives it to you fast. If it's not there (a cache miss), it gets it from the main storage, gives it to you, and saves a copy in the cache for next time, so next time it's a hit, much faster!

Where is cache used? In lots of places: web browsers (storing images, scripts, and pages so sites load faster), operating systems, apps, the CPU (which uses several levels of cache, L1, L2, L3, to speed up computations), and CDNs (content delivery networks that store copies of content on servers closer to you).

The benefits are faster performance, lower latency, less load on main storage and servers, saved bandwidth, and a better experience. Cache makes everything feel snappy!

Any downsides? Cache is awesome but not perfect. Cached data can become stale (out of date), the cache is small so it can't store everything, and old data must be cleared to make room. The fixes: cache entries expire after a time, clear automatically, and can be cleared manually.

Remember: cache stores copies of frequently used data in a fast place, a hit is fast and a miss is slower, it's used all over (browsers, apps, CPUs), and it's like having a shortcut for the info you use most.

What to remember

  • Cache saves copies of data you use often, close by.
  • A 'cache hit' is fast; a 'cache miss' fetches from main storage.
  • It's used in browsers, apps, the OS, and CPUs.
  • Cache is small, so old data is cleared to make room.

Words to know

Cache
Fast storage for frequently used data.
Cache hit
The data was already in the cache, fast!
Cache miss
Not in cache, fetch it from main storage.
Stale data
Cached data that's now out of date.

For grown-ups

Cache is a small, fast layer that stores copies of frequently accessed data closer to where it's needed, CPU caches (L1/L2/L3), RAM/disk caches, browser caches, and CDNs. Hits are fast; misses fall back to slower storage. It trades a little freshness (stale data, eviction) for big speed and reduced load.

Want the full story? These go deeper: