Short definition
Caching — temporarily storing an earlier response or file so a later request can be handled faster and with less server work.
Also known as: cache, web cache.
Caching prevents the same information from being fetched or calculated from scratch every time. Browsers, CDNs and servers can each have their own cache layer.
How does caching work?
HTTP cache headers determine how long a response remains usable and whether it must be revalidated. Versioned files can be stored for a long time, while frequently changing HTML usually gets a shorter cache lifetime. Personal or sensitive responses do not belong in a shared public cache.
What does this mean for a small business?
Good caching reduces load times and pressure on the hosting server. The main practical risk is stale content after an update. A publishing process must account for each cache and either invalidate stale entries or give changed files a new version. Clearing every cache without a strategy makes problems hard to reproduce.
What should you check when configuring caching?
- give each version of an asset a unique filename;
- use shorter cache lifetimes for frequently changing HTML than for versioned images and fonts;
- use
privatewhen a browser may store the response but a shared cache must not, andno-storewhen no cache may store it; - test a release with both a warm and a cold cache;
How it relates to other website choices
A CDN often provides a shared cache close to visitors. The web hosting provider may also use server-side caching, while the browser stores files locally.
Source and further reading
MDN’s guide to the Cache-Control header explains browser and shared-cache directives in detail.