What Is Cache Scope?
Cache scope is the visibility boundary that controls which runs may read and write a given cache entry, for example limiting it to one branch, one repository, or sharing it across an organization. CI systems often restrict cross-branch reads for isolation while letting branches fall back to the default branch's cache. Scope balances reuse against isolation and security.
Why it matters
Too narrow a scope kills the hit ratio because feature branches cannot reuse the base branch's cache; too broad a scope risks one branch poisoning another's cache. GitHub Actions, for instance, lets branches read the default branch cache but not arbitrary sibling branches, a deliberate isolation choice.
Related concepts
- Branch, repo, or org-level boundaries
- Narrow scope lowers reuse; broad scope risks poisoning
- Default-branch fallback widens safe reuse