キャッシュスコープとは?
cache scope は、どの実行が特定の cache エントリを読み書きできるかを制御する可視性の境界です。例えば、1 つの branch、1 つのリポジトリに限定したり、組織全体で共有したりします。CI システムはしばしば隔離のために branch 間の読み取りを制限しつつ、branch がデフォルト branch の cache にフォールバックできるようにします。scope は再利用と隔離およびセキュリティのバランスを取ります。
なぜ重要か
scope が狭すぎると、feature branch がベース branch の cache を再利用できずヒット率が下がります。scope が広すぎると、ある branch が別の branch の cache を汚染する恐れがあります。例えば GitHub Actions は、branch がデフォルト branch の cache を読めるようにしますが、任意の兄弟 branch は読めません。これは意図的な隔離の選択です。
関連する概念
- branch、repo、または組織レベルの境界
- 狭い scope は再利用を減らし、広い scope は汚染のリスクがある
- デフォルト branch へのフォールバックは安全な再利用を広げる
関連ガイド
What Is a Cache Key?A cache key is the identifier that determines which cached entry a lookup retrieves, typically derived from t…
What Is Cache Hit Ratio?Cache hit ratio is the fraction of cache lookups served from the cache rather than recomputed or refetched, a…
What Is a Remote Cache?A remote cache stores build outputs in a shared, networked location so they can be reused across machines, CI…