A modern CPU runs at roughly 3 GHz — about 100× faster than main memory. Without cache, the processor would idle waiting for RAM nearly every cycle. Each level trades capacity for speed: smaller and closer means faster.
A typical webpage downloads dozens of files — HTML, CSS, JavaScript, images, fonts. Re-downloading them on every visit would waste bandwidth and slow page loads to a crawl. The browser keeps a copy on disk, controlled by HTTP cache headers like Cache-Control and ETag sent by the server.
Every URL like example.com must be turned into an IP address before any data can flow. Even a quick OS-level DNS lookup costs a system call and inter-process work. Browsers keep their own in-process DNS cache so common hostnames resolve at essentially zero cost — a hash table read in the same memory as the page itself.
When a DNS lookup misses every local cache, it can take a 50–300 ms round trip through your router, your ISP, the root servers, the TLD servers, and finally the authoritative nameserver. The OS keeps a system-wide cache so a lookup done by your terminal warms the cache for your browser, your mail client, and everything else.
Reading from a relational database means parsing SQL, planning a query, hitting disk, locking rows, and serialising results — easily 50–200 ms. Redis keeps the answers to hot queries in RAM, so repeat reads return in about a millisecond and the database is freed up to do real work.