Caching

Cache Invalidation

Cache invalidation prevents stale cached data from being reused after relevant inputs change. Build systems can invalidate entries through content hashes, versioned keys, explicit deletion, or rules describing dependencies between inputs and outputs.

Why it matters

Correct invalidation prevents fast builds from silently returning obsolete results.

Practical example

Include the compiler version and lockfile hash in a cache key when either can change the output.

Related terms

Sources

Definition reviewed .

Start with $10 in free credits

Change the runner label in your workflow and keep the rest of your GitHub Actions setup. Runner time is billed per minute.

← Return to glossary