Developer concepts

What is caching?

A fast, nearby copy of data that's slow or expensive to get.

Why does a website load slowly the first time, and almost instantly the second? Caching.

What it is

A cache is a fast, nearby copy of data that's slow or expensive to get. Instead of doing the work again, you reuse the answer.

How it works

When a request comes in, check the cache first. If the answer is there, that's a cache hit, and you're done. If not, it's a miss: do the slow work, then save the answer in the cache for next time. Caches live everywhere: in your browser, on servers, and in memory stores like Redis.

Why it matters

It makes apps faster and cheaper to run. The catch is staleness: when the real data changes, the cached copy has to be updated or thrown away.

More from The Benmore Brief on YouTube

Put AI to work in your business.

Benmore's forward deployed engineers build and connect the software, from discovery to deployment.

Talk to us