---
title: "Move optional cache uploads off the merge gate"
description: "Let required checks finish without waiting for optional cache publication, while keeping cache writes available to later runs."
url: https://starsling.dev/ci-playbooks/techniques/cache-uploads-off-gate
canonicalUrl: https://starsling.dev/ci-playbooks/techniques/cache-uploads-off-gate
---

# Move optional cache uploads off the merge gate

Let required checks finish without waiting for optional cache publication, while keeping cache writes available to later runs.

## How to choose an approach

Compare the examples by repository setup, prerequisites, and risks before adopting one. Each company implemented this in its own environment; measure each change against your own baseline.

- **[Linear](https://starsling.dev/ci-playbooks/linear#cache-writes-off-the-merge-path)**: Use it when A write only benefits future runs and is not part of the current run’s correctness. Check before adopting: Keep every test, required status and artifact dependency. Confirm the current run’s correctness never depends on the write before moving it off the required checks.
- **[OpenAI](https://starsling.dev/ci-playbooks/openai#restore-without-saving)**: Use it when Tests pass but post-job cache compression eats into the job's deadline. Check before adopting: A restore-only job needs a compatible trusted producer that runs often enough to keep the cache warm. Keep required checks and their limits as they are.

## Apply this technique

````text
Evaluate and apply this CI technique to my repository: Move optional cache uploads off the merge gate.

Let required checks finish without waiting for optional cache publication, while keeping cache writes available to later runs.

Read the technique and its source-backed company examples: https://starsling.dev/ci-playbooks/techniques/cache-uploads-off-gate.md

Inspect this repository’s CI workflows, build and test commands, dependencies, and recent run timings. Identify where this technique applies and explain the expected benefit using this repository’s evidence.
Measure a baseline from recent comparable runs: elapsed time, queue time, runner minutes and failures where available. If data is unavailable, say what cannot be measured.
Compare relevant company approaches, checking prerequisites, platform differences and tradeoffs. Rank applicable options by evidence, fit and measurable opportunity; do not present company results as predictions for this repo.
Recommend the smallest safe change, show what checks and fallback paths remain, and ASK ME WHICH CHANGE TO APPROVE BEFORE EDITING ANY FILES.
Only after approval, work on a new feature branch, make one reversible change, and open a reviewable pull request. Never merge or push to a default or protected branch.
Keep required checks, test coverage, deployment and release behavior intact. Validate the change and compare equivalent runs where possible; report limitations and what should be monitored after merge.
````

## How companies used this technique

Read what each company changed and follow the original sources.

### Linear: Let optional cache writes finish after the merge gate

Linear moved cache-marker writes into a job downstream of the test shards that gates nothing. That took 42 seconds off the merge path for every API pull request and merge-queue entry.

Evidence: Company-reported result or observation

This change took 42 seconds off the merge path. Together with the checkout changes before it in Linear’s post, the section took roughly a minute off the required check for API pull requests on cache misses, while also reducing runner starts. ([Source](https://linear.app/now/ci-bottleneck-reworked#minimize-what%27s-on-the-critical-path))

Use it when: A write only benefits future runs and is not part of the current run’s correctness.

Before applying it: Keep every test, required status and artifact dependency. Confirm the current run’s correctness never depends on the write before moving it off the required checks.

[Read more in the Linear playbook](https://starsling.dev/ci-playbooks/linear#cache-writes-off-the-merge-path)

[Primary source](https://linear.app/now/ci-bottleneck-reworked#minimize-what%27s-on-the-critical-path)

### OpenAI: Keep cache uploads outside required test jobs

The CLI's required native help jobs now restore caches without compressing and uploading them after the tests. Windows x64 restores the archive other CI jobs produce; main-only warmers own the saves, capped at five minutes and non-fatal.

Evidence: Source PR/commit evidence

Required native jobs restore caches; warmers on main save them ([Source](https://github.com/openai/openai-cli/pull/602))

Use it when: Tests pass but post-job cache compression eats into the job's deadline.

Before applying it: A restore-only job needs a compatible trusted producer that runs often enough to keep the cache warm. Keep required checks and their limits as they are.

[Read more in the OpenAI playbook](https://starsling.dev/ci-playbooks/openai#restore-without-saving)

[Primary source](https://github.com/openai/openai-cli/pull/602)

## CI optimization is continuous work.

Apply this technique yourself, or use StarSling Runners for faster GitHub Actions and optional agent-driven optimization PRs, which teams on eligible paid plans can turn on.

[Get self-improving CI](https://starsling.dev/products/runners)

## Company Playbooks

### [Anthropic](https://starsling.dev/ci-playbooks/anthropic)

Run only affected tests

### [DoorDash](https://starsling.dev/ci-playbooks/doordash)

Run build and test in parallel, sharded across CI agents

### [Linear](https://starsling.dev/ci-playbooks/linear)

Benchmark the same job on faster hardware

### [Mastra](https://starsling.dev/ci-playbooks/mastra)

StarSling runners for the slowest test workflow

### [OpenAI](https://starsling.dev/ci-playbooks/openai)

Rank CI fixes by the minutes they save

### [Ramp](https://starsling.dev/ci-playbooks/ramp)

Move a CPU-bound test suite to a faster CPU

### [Shopify](https://starsling.dev/ci-playbooks/shopify)

Let an agent iterate against one CI metric

### [Spotify](https://starsling.dev/ci-playbooks/spotify)

Build arm64 on native arm64 runners

### [Stripe](https://starsling.dev/ci-playbooks/stripe)

Run only the tests a change can reach

### [Uber](https://starsling.dev/ci-playbooks/uber)

Build the merge-queue speculations most likely to be needed

## Related guides

Implementation guides for this technique.

### [Keep non-required checks off the GitHub Actions critical path](https://starsling.dev/best-practices/github-actions/keep-advisory-checks-non-blocking)

A slow, non-required check on the PR critical path is pure wait. How to narrow or async advisory checks in GitHub Actions, without disabling real tests.
