# How to clear cache on a Mac

To clear app caches on a Mac, open Finder, press Shift+Command+G, type ~/Library/Caches and press Return. Delete the contents of the folders inside, then empty the Trash. Apps rebuild what they need the next time they open.

Source: https://activityplusmac.com/guides/clear-cache-mac

## Clear app caches

1. Quit the apps whose caches you want to clear.
2. In Finder, press Shift+Command+G and enter ~/Library/Caches.
3. Open a folder and move its contents to the Trash. Leave the folder itself in place.
4. Empty the Trash to free the space.

## Clear the Safari cache

1. Open Safari, then Settings, then Advanced.
2. Turn on the option that shows features for web developers.
3. Open the Develop menu and choose Empty Caches, or press Option+Command+E.

## Clear the Chrome cache

In Chrome, press Shift+Command+Delete, tick Cached images and files, choose a time range, and click Delete data.

## What is safe and what is not

- Safe: the contents of ~/Library/Caches. Apps recreate them.
- Safe: ~/Library/Logs, which holds diagnostic records.
- Leave alone: /System/Library/Caches and anything else under /System. macOS manages those itself.
- Think first: anything in Application Support. That is app data, not cache.

## Will it make the Mac faster?

Usually not. Caches exist to make apps load faster, so clearing them can slow things down for a short while. The real gain is disk space, which matters a great deal when the startup disk is nearly full.

## See how much space the caches are using

In Finder, press Shift+Command+G, enter ~/Library and press Return. Select the Caches folder and press Command+I. The Size line shows the total once Finder has finished counting. Anything from a few hundred megabytes to 10 GB is ordinary. Browsers, music and video apps, and developer tools are usually the largest.

## Clear the Firefox cache

1. Open Firefox, then Settings, then Privacy & Security.
2. Under Cookies and Site Data, click Clear Data.
3. Tick the option for cached files and pages, leave cookies unticked if you want to stay signed in, and click Clear.

## Clear system caches by starting in Safe Mode

macOS keeps its own caches, such as the font cache and the kernel cache. Do not delete those by hand. Starting the Mac in Safe Mode clears them for you, and starting normally again rebuilds them.

On a Mac with Apple silicon, shut down, then hold the power button until the startup options appear, select your disk, hold Shift and click Continue in Safe Mode. On an Intel Mac, restart and hold Shift until the login window appears. Then restart normally.

## Flush the DNS cache

If a website will not load on your Mac but works elsewhere, the stale part may be the DNS cache, which remembers where websites live. Open Terminal, paste sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder and press Return. Type your password when asked. Nothing is printed when it works.

## Developer caches

- Xcode build data: delete the contents of ~/Library/Developer/Xcode/DerivedData. It is rebuilt on the next build.
- Homebrew: run brew cleanup to remove old downloads.
- npm: run npm cache clean --force. Packages are downloaded again when needed.
- Docker: run docker system prune to remove stopped containers and unused images.

These are often far larger than app caches. Xcode build data alone can reach tens of gigabytes.

## What clearing the cache will not fix

It will not speed up a Mac that is short of memory or running hot, and it will not remove malware. If the goal is a faster Mac, find out what is slow first: an app using a lot of processor, full memory, or a nearly full disk. Clearing caches only helps with the last one.

## With Activity+

The Disk tab in Activity+ measures app caches, logs, Xcode build data and developer package caches, and shows how much each one holds.

One click moves a category to the Trash after asking you to confirm. Nothing is deleted outright, so you can put it back until you empty the Trash.

## Questions

### Is it safe to delete everything in the Caches folder?

Deleting the contents of ~/Library/Caches is safe. Apps rebuild what they need. Quit the apps first, and delete the contents of each folder rather than the folders themselves.

### How often should I clear the cache on my Mac?

Only when you need the space or an app is misbehaving. There is no benefit in clearing caches on a schedule.

### Where is the cache stored on a Mac?

Most app caches are in the Caches folder inside your user Library, at ~/Library/Caches. The system keeps its own in /Library/Caches and /System/Library/Caches.

### Does clearing the cache delete my passwords or files?

No. Caches hold copies an app can fetch or build again. Passwords are in the keychain and your files are elsewhere. Clearing a browser's cookies is a separate choice, and that one does sign you out of websites.

### How do I clear the cache on a Mac without an app?

In Finder, press Shift+Command+G, enter ~/Library/Caches, delete the contents of the folders inside and empty the Trash. Nothing else is needed.

### Why does the cache come back?

Because apps rebuild it as you use them. That is what a cache is for. It should settle at a similar size after a few days of normal use.
