The repo hits the 10 GB cache limit daily and hit rates are poor. What do you change?
IntermediateScenarioSpeed, Caching & Cost
Answer
Situation read → Cache thrashing: too many large, unique caches.
What I'd do →
gh cache list --sort size_in_bytes --limit 30to find the biggest keys.- Save caches only on
main(actions/cache/restoreeverywhere,actions/cache/savewithif: github.ref == 'refs/heads/main'). - Remove
github.shaor run IDs from keys where not needed. - Give Docker caches a
scopeand move big ones to registry cache. - Delete PR caches on PR close (
gh cache delete --ref refs/pull/N/mergein a cleanup workflow).
Why → LRU eviction across branches throws away the useful main caches first when PRs flood the store.
Interview tip → "Write caches on main, read them everywhere."
More on Speed, Caching & Cost
`npm ci` takes 4 minutes on every run. Fix it.BeginnerDocker builds take 12 minutes even when only one line of code changed. Speed them up.IntermediatemacOS jobs are 60% of your bill. What are your options?IntermediateA job sometimes hangs and burns 6 hours. How do you stop it happening again?BeginnerYour PR matrix is 3 OS times 4 versions (12 jobs). How do you cut cost without losing coverage?AdvancedTest suite takes 30 minutes on one runner. How do you parallelize it in Actions?Intermediate