Caching
In depthConcept
Also known as: Cache
Temporarily keeping frequently requested data in a fast location to avoid repeating expensive work.
Caching, explained
Written by EduVerseWhat it is
Caching means keeping a copy of data somewhere fast, so the next time someone asks for it you don’t have to fetch or calculate it again. A cache can live in many places: the browser, a CDN close to the user, your application’s memory, or a separate store such as Redis.
Why teams use it
Databases and external APIs are slow compared to reading from memory, and many requests ask for the same data. A cache cuts response times and takes load off the systems behind it. The hard part is stale data: when the original changes, you have to decide how long a cached copy may live or when to remove it.
An example from work
You update a product price in the admin screen, but the shop page keeps showing the old price. The product list is cached in Redis for ten minutes, so the page reads that copy instead of the database. Either you wait for the entry to expire, or your update code deletes that cache key when the price changes.
Our own explanation, not a quote from the book.
In the book
Sentences from The Software Realm, Decoded that mention Caching, exactly as printed.
3 more passages about Caching in the full book
Read every conversation where Caching comes up, with the interactive slides and demos.
Where it fits
Performance gains at every layer (browser, CDN, server, database)
Coverage in the book
Covered in depth: multiple pages with explanations, examples and simulations.