Software Engineering ยท Performance
Storing the result of expensive work so a later request can reuse it instead of recomputing or refetching from scratch.
Mental model: Like keeping leftovers in the fridge instead of cooking from scratch every time.
Example: Storing a product page's rendered HTML for 60 seconds so the next 1,000 visitors get it instantly instead of hitting the database.
In practice: The hard part of caching is invalidation โ deciding when cached data goes stale and needs refreshing, which is why 'cache invalidation' is a running joke about hard problems in computer science.