cache invalidation

Marking cached copies as out of date, or deleting them, when the real data changes so the next read fetches fresh data.

In more detail

Invalidate too little and users see stale data; invalidate too much and the source is flooded with refetches. Targeted strategies include hierarchical keys, tags on cached items and messages that tell every copy to drop an entry.

Examples

TanStack Query key prefixes, surrogate tags for server caches, and Redis pub/sub to clear every node’s local copy.
After saving a profile, invalidate the related keys and React components refresh, suspending again if needed.

Related terms

Taught in

References