Ram
All topicsTopic 09 / 24
Beginner 1 minute

Caching

A cache stores a reusable copy of data so future requests can avoid slower work. It can reduce database load and improve response time, but cached data can become stale and must eventually expire or be invalidated. Decide what is safe to cache, how long it can live, and what happens on a miss before adding one.

Key idea

Cache hits are fast; cache misses follow the normal path and refill the cache.

See it in one picture

Follow the arrows

Real-world example

A product page can check Redis for a popular item's details first. On a miss, the application reads the database, returns the item, and stores a short-lived copy for the next shopper.

Quick check

Can you spot it?

0/2 answered
Question 1

1. What does a cache reduce?

Question 2

2. What is a cache miss?