Task Graph Cachingとは?
task graph cachingは、依存グラフ内の各taskの入力をハッシュ化し、そのハッシュの下に出力を保存するbuild toolの手法です。taskの入力が変更されていない場合、toolはtaskを再実行するのではなくキャッシュされた出力を復元します。共有backendと組み合わせることで、結果はマシン間で再利用されます。
なぜ重要か
buildをcache可能なtaskのグラフとしてモデル化することは、実際の変更の下流にあるtaskだけが実行され、それ以外はすべてcache hitになることを意味します。これが高速なincrementalなmonorepo buildを支えるエンジンです。CI runner間でcacheを共有すると、あるrunnerの作業が次のrunnerにとって無料のhitになり、build minutesを削減できます。
関連ガイド
What Is a Monorepo Affected Graph?A monorepo affected graph is the set of projects impacted by a change, computed from the dependency graph so…
What Is a Remote Cache Backend?A remote cache backend is shared storage where build and test caches live so many machines and CI runs can re…
What Is Cache Warming?Cache warming pre-populates a cache before it is needed so the first real requests hit a ready cache instead…