Caching
Storing computed or fetched data closer to where it is needed so it does not have to be produced again.
Analogy Mental model
Keeping the tools you use constantly on the bench rather than walking to the store room for each one.
In practice What you actually do
Four layers, each with its own policy: browser, CDN, application page cache, and object or query cache. Static assets with a version in the filename can live a year; HTML should live minutes to hours, with an explicit purge when content changes.
Where people get burned Pitfalls
A cache is a copy of the truth, and the copy drifts. Every layer needs an invalidation path somebody tested, otherwise the site serves a price from last Tuesday and nobody can reproduce it.
This entry was written in English from the Chinese original, not machine-translated. Read the Chinese version →