Cache
/kæʃ/ · Noun · Verb · Development
Definitions
Cache is a high-speed storage layer that keeps copies of frequently accessed data so future requests can be served faster than fetching from the original, slower source. Caching operates at virtually every level of computing. CPU caches (L1, L2, L3) store recently accessed memory to avoid slow main RAM lookups. Disk caches buffer file system reads in RAM. Browser caches store downloaded assets like images, CSS, and JavaScript locally. CDN caches distribute content to edge servers near users. Application-level caches using tools like Redis or Memcached store database query results or computed values. The fundamental challenge of caching is invalidation: knowing when cached data is stale and needs to be refreshed. Phil Karlton famously said there are only two hard things in computer science: cache invalidation and naming things. Cache strategies include write-through, write-behind, read-through, and time-based expiration (TTL). Effective caching can improve application performance by orders of magnitude.
In plain English: A fast storage spot that remembers recent results so the system does not have to redo slow work every time the same thing is requested.
Example: "We put a Redis cache in front of Postgres and the p95 response time dropped from 200 ms to 8 ms."
Etymology
- 1967
- The term 'cache' was first used in computing by IBM engineer Lyle Johnson to describe a high-speed buffer memory in the IBM System/360 Model 85.
- 1980s
- CPU caches became standard in microprocessor design. Multi-level cache hierarchies (L1, L2) emerged as the gap between processor speed and memory speed widened.
- 1990s
- Web caching became critical with the growth of the internet. Browser caches, proxy caches (like Squid), and CDN caches reduced bandwidth and latency.
- 2000s-Present
- In-memory caching systems like Memcached (2003) and Redis (2009) became infrastructure staples. The term now spans hardware, OS, application, and network layers.
Origin Story
The Hiding Place That Made Computers Fast
The word 'cache' comes from the French 'cacher,' meaning to hide, and in computing it refers to a small, fast storage layer that keeps frequently accessed data close at hand. The concept was first formalized for computer architecture in a 1968 IBM paper by Maurice Wilkes, who proposed placing a small, high-speed memory between the CPU and main memory to bridge the growing speed gap. Wilkes observed that programs tend to access the same data repeatedly (a property called locality of reference), so storing recent results in a fast buffer would dramatically cut wait times. The IBM System/360 Model 85, released that same year, became one of the first commercial machines to include a hardware cache. The idea quickly proved so effective that caches proliferated everywhere: CPU L1/L2/L3 caches, disk caches, DNS caches, browser caches, and CDN caches all follow the same fundamental principle. Today, nearly every layer of a modern computing stack relies on caching to deliver the speed users expect, from a web page loading in milliseconds to a database query returning in microseconds.
Coined by: Maurice Wilkes
Context: Formalized in a 1968 paper proposing a small fast memory buffer to bridge the CPU-to-RAM speed gap.
Fun fact: A modern CPU's L1 cache can deliver data in about 1 nanosecond, while fetching from main RAM takes roughly 100 nanoseconds. That 100x difference is why cache misses are among the most common performance bottlenecks in software.
Related Terms
- Allocatable
- Buffer
- Chunk
- Common Block
- Comptime
- Concurrency
- Frame Rate
- Memory Allocation
- Mex
- Native
- Profile
- Retain Cycle
- Segfault
- Smart Pointer
- Struct
- Tail Call
- Vectorization
- Weak Reference
- Working Storage
- Protocol Buffers
- Tail Latency
- Hot Path
- Memoization
- Apache Arrow
- MessagePack
- Edge Function
- Memory Pool
- Copy-on-Write
- Page Fault
- OOM Killer
- Memory Leak
- Dynamic Programming
- Greedy Algorithm
- CPU Cache
- First Contentful Paint
- Largest Contentful Paint
- Build Cache
- USE Method
- Dynamic Memory Allocation
- Heap Memory
- Lazy Initialization
- Lookup Table
- Loop Unrolling
- Page Cache
- Prefetch
- Profile Guided Optimization
- Profiler
- Random Access
- Static Variable
- String Builder
- String Pool
- Time Complexity
- Turbolinks
- Unrolling
- Value Type
- Wasm
- Write Back
- Zap
- Time to First Byte Culture
- Code Performance
- Constraint Programming
- Custom Allocator