Caching
/ˈkæʃ.ɪŋ/ · Noun · Verb · Development
Definitions
Caching is the practice of storing frequently accessed data in a faster storage layer so subsequent requests skip expensive computations, database queries, or network calls. Caches exist at every level: CPU caches (L1, L2, L3) speed up memory access; browser caches store static assets locally; CDN caches serve content from edge locations near users; and application-level caches like Redis and Memcached hold query results or session data in memory. Cache invalidation, deciding when cached data is stale, is notoriously difficult. Strategies include time-to-live (TTL) expiration, write-through caching (updating cache on every write), and cache-aside (loading into cache on demand). Effective caching can reduce latency by orders of magnitude.
In plain English: Saving frequently needed data somewhere fast so you don't have to look it up every time — like keeping a recipe on your counter instead of digging through the cookbook.
Cache invalidation — knowing when cached data is stale and needs refreshing — is famously one of the hardest problems in computer science. Strategies include TTL (time-to-live), write-through, write-behind, and cache-aside, each with different consistency tradeoffs.
Example: 'We cached the user profile aggressively and now name changes take 30 minutes to propagate. Classic cache invalidation problem.'
Source: invalidation challenge
Etymology
- 1967
- The term 'cache' entered computing via IBM's System/360 Model 85. Caching as a general strategy of storing frequently accessed data closer to the requester was born.
- 1980s
- CPU caches, disk caches, and OS page caches made caching a multi-layered concern in systems design. Cache coherence protocols addressed multi-processor consistency.
- 1990s
- Web caching became critical as the internet scaled. CDNs, browser caches, and HTTP cache headers (Expires, Cache-Control) formed a distributed caching hierarchy.
- 2000s-Present
- Application-level caching with Redis, Memcached, and framework-integrated caches became standard. Cache invalidation remained famously one of the two hard problems in computer science.
Origin Story
The Art of Remembering So You Don't Have to Recompute
Caching, the practice of storing computed results or frequently accessed data for faster future retrieval, is one of the oldest and most pervasive optimization strategies in computing. While the hardware cache concept dates to the 1960s (see: Cache), software caching evolved as a distinct discipline through the 1990s and 2000s as web applications exploded in scale. Memcached, released by Brad Fitzpatrick in 2003 for LiveJournal, became the first widely adopted distributed caching system, allowing web applications to store session data and query results in memory across multiple servers. Redis, created by Salvatore Sanfilippo in 2009, added data structures and persistence, becoming the Swiss Army knife of caching infrastructure. The rise of CDNs like Akamai (founded 1998) and Cloudflare (founded 2009) brought caching to the network edge, storing static assets physically closer to users around the world. Today, caching operates at every layer of the modern stack: browser caches, DNS caches, application-level caches, database query caches, and CDN edge caches all work in concert. The discipline's core challenge remains cache invalidation, famously called one of the two hard problems in computer science by Phil Karlton.
Context: Software caching evolved through contributions from Fitzpatrick (Memcached, 2003), Sanfilippo (Redis, 2009), and CDN pioneers.
Fun fact: Phil Karlton's famous quote, 'There are only two hard things in Computer Science: cache invalidation and naming things,' has itself been cached, copied, and slightly mutated across the internet thousands of times, becoming a recursive illustration of its own point.