CI cache blowout fix: write cache only on pushes to main, restore-only on PRs

DanielLockyer · x · 2026-11-04

Daniel Lockyer describes a common CI problem: caching on every build of every PR blows through default cache limits (10-25GB), platforms start LRU-evicting, and most workflows end up running with no cache at all.

His proposed fix: only store cache on pushes to main, and make PR builds restore-only. This keeps the cache pool from being evicted and lets PRs reliably hit warm caches.

Related event: Developer Warns Common CI Cache Antipattern Blows Storage Limits(2 posts)→

Original post →

More from coding & agent

coding & agent channel →