Maturity Matrix

Basic caching

Basic caching in CI refers to storing dependency packages, compiled artifacts, and Docker layers between pipeline runs so they don't need to be re-downloaded or re-built from scratch on every commit.

  • ·CI completes in under 10 minutes (median)
  • ·Build caching is implemented (dependency cache, build artifact cache)
  • ·Dedicated CI runners are allocated per team (no shared queue across all teams)
  • ·CI duration is tracked as a metric and reviewed monthly
  • ·Cache hit rate exceeds 70%

Evidence

  • ·CI run duration dashboard showing median under 10 minutes
  • ·Cache configuration in CI pipeline (e.g., actions/cache, Gradle build cache)
  • ·Runner allocation configuration showing per-team resources

What It Is

Basic caching in CI refers to storing dependency packages, compiled artifacts, and Docker layers between pipeline runs so they don't need to be re-downloaded or re-built from scratch on every commit. It is the first and most accessible optimization available to teams trying to speed up their CI pipelines, and it's available natively in every major CI platform - GitHub Actions, CircleCI, BuildKite, and GitLab CI all provide built-in cache primitives that require no additional infrastructure.

The mechanism is straightforward: before a CI job runs its main steps, it checks a cache store (keyed on a hash of your dependency lock file) for previously computed outputs. If the cache hits, it restores those outputs and skips the download or build step entirely. If the cache misses (because the lock file changed), it runs the step normally and saves the output to the cache for the next run. The result is that 80-90% of CI runs - those that don't change dependencies - skip the most time-consuming setup steps entirely.

For dependency managers, caching typically saves 3-8 minutes per run. npm, pip, maven, and gradle all benefit significantly. A Node.js project that installs 500 packages in 4 minutes without caching consistently installs in 15-30 seconds with a warm cache. For Docker builds, layer caching means that layers whose inputs haven't changed are served from cache rather than rebuilt - a 5-minute Docker image build becomes a 30-second layer diff push. These are among the highest-ROI changes available in CI optimization: meaningful speedup with minimal engineering effort.

For teams adopting AI agents, basic caching is the prerequisite that makes further optimization possible. Agents generate more CI runs per hour than human developers do. A team that goes from 5 pushes per day to 50 pushes per day (driven by agent activity) without caching will see its CI runner costs and queue times multiply by 10x. Caching absorbs most of that load increase because dependency downloads, the most expensive step, are served from cache rather than network.

Why It Matters

  • Most impactful CI optimization per hour of engineering effort - dependency caching typically saves 3-8 minutes per run and can be implemented in 1-2 hours with native CI platform primitives
  • Scales CI cost linearly with dependency changes, not with commit frequency - agents generate many more CI runs than humans; caching ensures those runs don't multiply infrastructure costs proportionally
  • Required foundation for all further optimization - incremental builds, test impact analysis, and distributed caching all assume a functioning basic cache layer; caching must come first
  • Reduces runner capacity requirements - faster runs mean runners are available sooner for the next job in the queue; caching reduces the required runner pool size for a given throughput
  • Improves developer experience immediately - 5-minute runs that drop to 2 minutes after caching is enabled are visible and tangible; the team sees the improvement without waiting for a longer optimization project

Getting Started

6 steps to get from here to the next level

Common Pitfalls

Mistakes teams actually make at this stage - and how to avoid them

How Different Roles See It

B
BobHead of Engineering

Bob's team has 18-minute CI and he's just committed to a 30-day target of 10 minutes. He's not sure where to start, and the team has limited bandwidth for CI work. He wants the highest-ROI first move.

Bob should direct the CI owner to implement dependency caching in the first two days. It's a configuration change, not a refactor - a few lines of YAML in the CI config - and typically produces 5-8 minutes of speedup immediately. Bob should ask for a before/after timing report after caching is enabled so he can quantify the improvement and decide on next steps. If caching drops CI from 18 to 11 minutes, the team is close to the 10-minute target and can likely get there with a small amount of test parallelization. If caching drops CI from 18 to 14 minutes, there's a bigger structural problem (maybe the test suite itself is slow) that needs investigation. The caching data tells Bob which problem he actually has.

S
SarahProductivity Lead

Sarah wants to show the team that CI optimization is worthwhile, but she's been struggling to make the case with anecdotes. "CI is slow" is a complaint, not a business case. She needs data that shows the cost of current slowness and the benefit of optimization.

Sarah should calculate the "dependency download tax" - how many developer-hours per week are spent waiting for dependency downloads across all CI runs. If the team runs 200 CI jobs per day and each currently downloads dependencies for 4 minutes, that's 800 developer-minutes per day (assuming one developer is waiting per run). After caching, that drops to 800 minutes × (30 seconds / 240 seconds) = 100 developer-minutes per day. The savings is 700 developer-minutes - nearly 12 developer-hours - per day, from a configuration change that takes 2 hours to implement. That's the ROI calculation that makes CI optimization a no-brainer. Sarah should run these numbers, present them to Bob, and use them to justify prioritizing CI work in the next sprint.

V
VictorStaff Engineer - AI Champion

Victor has already set up basic caching for his own repositories and knows it works. He's noticed that different teams on the same GitHub organization are each maintaining their own cache configurations - some correctly, some incorrectly (wrong keys, wrong directories). The result is inconsistent CI performance across teams even though the fix is simple and standardized.

Victor should write a shared workflow template that encapsulates the correct caching configuration for each supported tech stack (Node.js, Python, Java, Go). Teams can call this template with uses: org/ci-templates/.github/workflows/cache-setup.yml@main rather than copying YAML into each repository. The template centralizes the correct implementation and ensures consistency. Victor should also add a "caching health check" job to the template that logs whether the cache hit or missed on each run, making it easy to audit whether caching is actually working across the organization.