Skip to content
Browser internals·Intermediate·Conceptual·1 min read

Why is deleting old cache versions during the activate event important?

Short interview answer

Each deploy that changes the cache name creates a new, separate cache; if old caches are never deleted, they accumulate indefinitely in the user's storage and can be accidentally matched by a caches.match() call that isn't scoped to the current cache name, serving stale assets alongside current ones.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to Service workers, caching, and offline support

Related questions