Skip to content

Cache

In one line

A cache is a temporary storage that keeps frequently accessed data so it can be served faster without re-fetching from the original source.

In simple words

Caching is the practice of storing copies of data in a fast-access location so future requests can be served faster. On the web, caching happens at multiple levels: browser cache, CDN cache, and server cache.

The browser cache stores downloaded resources (HTML, CSS, JS, images) so that on the next visit, they can be loaded from disk instead of re-downloading. HTTP headers control this: Cache-Control sets caching directives (max-age, no-cache, no-store), and ETag/Last-Modified enable conditional requests.

Effective caching dramatically improves page load speed and reduces server load. The tradeoff is that cached content can become stale. Cache-busting techniques (versioned filenames, query parameters) ensure users get fresh content when it changes.

Example

http
Cache-Control: public, max-age=3600
ETag: "abc123"

// Browser caches for 1 hour (3600 seconds)
// Next request: If-None-Match: "abc123"
// Server: 304 Not Modified (use cache)

HTTP caching headers: Cache-Control sets the lifetime, ETag enables efficient revalidation with 304 responses.

Related terms

Related Resources

Related Lessons

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to glossary