1 of 4

Your RightSignal

Systems design · 2 of 121 / 3

Caching

The concept

Why a website loads faster the second time you visit

A cache is a small, fast store that keeps copies of answers already fetched or computed. Your browser saves a site's logo and scripts on disk, so your next visit loads them in milliseconds instead of over the network.

Each lookup is a hit (the copy is there, so it's served fast) or a miss (it isn't, so you fetch it from the slow source and usually keep a copy).

A full cache needs an eviction policy, a rule for what to drop. LRU (least recently used) throws out whatever hasn't been touched for longest.