Do Mac caches come back after you clear them?

Over five weeks I cleared about 55 GB of developer caches from one Mac, and the Gradle cache alone was back to 7.3 GB six days after its last cleanup.

Shiva ChandraMaker of Clean House · · 5 min read
Short answer

Mac caches for tools you still use come back, often within days. On one MacBook I logged five weeks of clearing. The Gradle cache was cleared four times, 41 GB in total, and was back to 7.3 GB six days after the last time. Clearing helps most for tools you've stopped using. For tools you use every day, it's a short-term gain.

How I measured it

This isn't a lab test. It's one developer MacBook, used normally for iOS, Android, Python and JavaScript work, between 30 October and 4 December 2026.

Every time I cleared something with Clean House, the app wrote down what it moved to the Trash and how big it was at that moment. So when the same cache shows up in the log again a week later, the new size is roughly what grew back in between. On 4 December I measured the same folders again with du to see where they stand now.

All sizes below are in decimal gigabytes, the same unit Finder uses.

What grew back, cache by cache

CacheTimes clearedSizes when clearedSize on 4 Dec
Gradle cache412.9, 13.7, 6.9, 7.5 GB7.3 GB
npm cache43.35, 1.28, 2.52, 1.40 GB0.13 GB
uv cache (Python)33.17, 0.75, 0.41 GB0.19 GB
Xcode DerivedData build files20.44, 0.50 GB2.1 GB
Chrome component downloads30.40, 0.14, 0.06 GB0.01 GB
Bar chart: Gradle cache cleared 41.0 GB in total and was 7.3 GB on 4 December; npm 8.6 GB cleared, 0.13 GB now; uv 4.3 GB cleared, 0.19 GB now; Xcode DerivedData 0.9 GB cleared, 2.1 GB now; Chrome components 0.6 GB cleared, 0.01 GB now
What I cleared from each cache over five weeks, next to what it held again on 4 December.

Add it up and I cleared about 55 GB from these five caches in five weeks. On 4 December they held about 9.7 GB together. So the cleanups weren't wasted, but most of the space I "freed" was the same space, freed over and over.

Gradle: cleared four times, back every time

Gradle is the biggest example. It held 12.9 GB on 30 October. Two weeks later it was 13.7 GB again. After that I cleared it on 26 November (6.9 GB) and again two days later on 28 November, when it had already refilled to 7.5 GB. Six days after that, on 4 December, it was 7.3 GB.

That's what Android work does. Every project build downloads the libraries it needs into this cache, and the Android plugin and its dependencies are large. Clearing it means the next build downloads them all again.

Gradle already cleans up after itself. According to its manual, it deletes cache files it hasn't used for 7 or 30 days, depending on whether it can rebuild the file or must download it again, and removes unused Gradle versions after 30 days. So a Gradle cache that stays around 7 GB is mostly libraries you really use. There's more on what's inside in the Gradle and Android storage guide.

Lesson: clearing the Gradle cache on a Mac you build Android apps on every day buys you a few days. Clear it when you stop Android work for a while, not as a weekly habit.

npm and uv: big once, smaller after

The npm cache was 3.35 GB the first time I cleared it. After that it refilled to between 1.28 and 2.52 GB each time, in 6 to 12 days. Today it's 0.13 GB, because I haven't installed many packages this week.

npm's own documentation says clearing the cache is "typically unnecessary" because it is self-healing. That matches what I saw. The first cleanup removed years of packages I'd never need again. Later cleanups mostly removed packages I was about to download again.

The uv cache for Python behaved the same way, only faster to settle: 3.17 GB the first time, then 0.75 GB, then 0.41 GB. The first cleanup took out old packages. After that, only what my current projects used came back.

Xcode DerivedData: grows fastest when you're building

DerivedData was small when I cleared it: 0.44 GB on 30 October and 0.50 GB on 29 November. Then I started building an iOS project every day. On 2 December the folder was 0.8 GB. Two days later it was 2.1 GB.

Xcode keeps build products and indexes per project there, so a project you're working on refills it with every build. Clearing it costs you one slow full build per project. It's worth it for projects you've finished or deleted, and only rarely for the one you're working on today. The Xcode storage guide shows the bigger Xcode folders, which on my Mac were simulators, not DerivedData.

Chrome component downloads: the one that stayed gone

Chrome's component download folder went 0.40 GB, then 0.14 GB, then 0.06 GB, and is about 0.01 GB today. Chrome only downloads these again when it needs an update, so each cleanup removed things that really were finished with. This is what a good cleanup looks like: the space stays free.

I never cleared Chrome's main browsing cache in this period. It was 1.5 GB on 2 December and 1.6 GB on 4 December, and that's normal for a browser you use all day. What the Chrome cache holds explains why clearing it mainly makes pages load slower for a while.

So which cache cleanups are worth it?

SituationWorth clearing?Why
First cleanup in yearsSafe to clearRemoves packages and builds you'll never use again. My first round was the biggest every time.
Cache for a tool you stopped usingSafe to clearNothing refills it. The space stays free.
Cache for a tool you use dailyLook firstIt comes back in days and costs you slower builds or downloads.
Disk nearly full right nowSafe to clearA few days of space can be enough to finish an update or a build.

How to keep a cache from filling up again

  1. Check which caches are big right now: du -sh ~/.gradle/caches ~/.npm/_cacache ~/.cache/uv ~/Library/Developer/Xcode/DerivedData
  2. Write down the sizes. Check again in a week. Anything back near its old size belongs to a tool you use, so leave it alone.
  3. For caches that didn't come back, clear them, or let a cleaner move them to the Trash.
  4. For the ones that refill, use the tool's own cleanup. uv cache prune removes unused entries in the uv cache. Gradle does it on its own, and npm's docs advise against routine clearing.

Where Clean House fits

This log came from Clean House, which keeps a record of what it moves to the Trash and how big it was. Its Why? card tells you before you clear whether a cache comes back. Caches that refill get a way to cap them instead of being cleared over and over. Everything goes to the Trash first, and Recently Cleared puts things back until you empty it.

If your Mac is full of build caches for projects you've finished, clearing is still the right move. Just don't expect the space from caches you use every day to stay free.

Questions

Do caches come back after clearing them on a Mac?

Caches for tools you still use do. On my Mac the Gradle cache was back to 7.3 GB six days after I cleared it. Caches for tools you stopped using stay gone.

Is it worth clearing the npm cache?

Only as a one-off. npm's own docs say clearing is typically unnecessary because the cache is self-healing. Mine refilled to between 1.3 and 2.5 GB each time I cleared it.

How fast does Xcode DerivedData grow back?

On my Mac it went from 0.8 GB to 2.1 GB in two days of normal iOS work. It refills with every project you build, so clearing it mainly helps for projects you've finished.

Does Gradle clean its own cache?

Yes. Gradle deletes cache entries it hasn't used for 7 or 30 days, depending on the file, and unused Gradle versions after 30 days. That keeps the cache from growing forever, but it doesn't keep it small while you're building Android apps every day.

Found a different folder? Look up a folder name or path.

Sources

  1. Gradle User Manual: Gradle directories and cache cleanup
  2. npm Docs: npm cache
  3. uv docs: Caching
  4. Apple Developer: Build system