HTTP caching is the set of rules by which a browser, proxy or CDN stores a response and reuses it for later requests. The server controls the behavior through response headers, mainly Cache-Control, ETag and Last-Modified.
Why it matters
The fastest request is the one never sent. A fresh cached file loads in milliseconds with no network use, and a revalidated one costs a tiny round trip instead of a full download. Good caching reduces server load, bandwidth and page load time for returning visitors.
There are two stages. Freshness decides whether the stored copy can be used without asking (max-age). Validation asks the server whether the copy is still current and gets a 304 Not Modified if so.
Example
# Fingerprinted asset, safe to cache for a year
Cache-Control: public, max-age=31536000, immutable
# HTML, always revalidate
Cache-Control: no-cache
ETag: "a1b2c3"
Despite its name, no-cache means "store it, but revalidate before use". no-store forbids storing.
Common mistakes
- Long
max-ageon files with stable names; users keep stale code. - Sending no caching headers and leaving heuristic freshness to the browser.
- Using
no-cacheandno-storeas synonyms.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.