How to clear the cache on a Mac (and when not to)
To clear app caches on a Mac, quit your apps, open ~/Library/Caches in Finder and move the contents of the large folders to the Trash. Browsers have their own menu commands for it, and system caches are best cleared by restarting.
Clearing caches is safe when done this way, but it is not free. Caches exist to make things faster, they grow back, and a few of them should be left to macOS. This guide covers each kind and says when it is worth doing.
What a cache is, and the three kinds on a Mac
A cache is a copy of something an app can get again: a downloaded image, a compiled script, a thumbnail. Keeping the copy saves the app from fetching or computing it twice. Deleting it loses nothing permanent. The app simply does the work again.
- App caches, in ~/Library/Caches in your home folder. This is where most of the space is. Sandboxed apps keep theirs inside their own folder in ~/Library/Containers instead.
- Browser caches. Safari, Chrome, Firefox and others store copies of the sites you visit. They are app caches too, but each browser has its own command to clear them.
- System caches, in /Library/Caches, /System/Library/Caches and /private/var/folders. macOS manages these itself.
Clear app caches in ~/Library/Caches
Start by seeing what is there. The command below lists the folders in your cache directory by size, largest last. It only reads sizes and deletes nothing.
Then quit the apps whose caches you want to clear. In Finder, choose Go, then Go to Folder, enter ~/Library/Caches and open the large folders. Move what is inside them to the Trash, and leave the folders themselves in place. Some apps expect their cache folder to exist.
Empty the Trash to get the space back. If something misbehaves afterwards, restart the app, or the Mac.
du -sh ~/Library/Caches/* 2>/dev/null | sort -h | tail -20Clear browser caches
Use the browser's own command. It clears the cache without touching bookmarks or passwords, and it works while the browser is running.
- Safari: open Safari, Settings, Advanced and tick Show features for web developers. Then choose Develop, Empty Caches.
- Chrome: open the Chrome menu and choose Delete Browsing Data. Set the time range to All time, tick only Cached images and files, and click Delete data.
- Firefox: open Firefox, Settings, Privacy and Security. Under Cookies and Site Data, click Clear Data and tick only the cached files option.
- In every browser, leave cookies unticked unless you want to be signed out of websites.
System caches: restart instead of deleting
Do not delete things in /System/Library/Caches or /private/var/folders by hand. Running apps and macOS itself have files open there, and removing them underneath can cause crashes or strange behaviour. Much of it is protected anyway.
A restart is the supported way. macOS clears temporary files that are no longer in use when it starts up. If you suspect a damaged system cache, start up in safe mode once and then restart normally: Apple says safe mode deletes some system caches, including font caches, which are rebuilt as needed.
One system cache has its own command: the DNS cache, which remembers the addresses of websites. Flushing it frees no space, but it helps when a site has moved and your Mac keeps going to the old address. The command below asks for your password and removes only those remembered addresses.
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderWhen not to clear caches
Clearing caches is often suggested as routine maintenance. It is not. A Mac does not get faster because its caches are empty, and usually feels slower for a while.
- If you have plenty of free space and nothing is misbehaving, there is nothing to gain.
- If an app is open, do not delete its cache. Quit it first.
- If the cache is expensive to rebuild, think twice. Developer caches such as Gradle or Go modules, offline music, and AI models can take a long time to download or build again.
- If you are trying to fix a full disk for good, caches are a short-term answer. They come back. Look for large files, old backups and unused apps too.
- If a folder is not a cache, leave it. ~/Library/Application Support and ~/Library/Containers hold real app data, not copies.
What happens after you clear them
Apps take longer to open the first time, websites load more slowly on the first visit, and streaming apps buffer again. Over the following days the caches fill back up, usually to a smaller size than before, because data for things you no longer use is not recreated.
That last part is the real benefit. The space you get back for good is the cache of apps you have stopped using or deleted, which would otherwise sit there indefinitely.
Clearing caches with Diskzy
Diskzy's Clean up tab finds caches, logs, package manager caches and similar files, and ticks or unticks each one with a reason. Browser and Electron app caches are ticked unless that app is open, and apps that are open are left alone. Caches that are slow to rebuild, such as Gradle caches and the Go module cache, are listed but unticked.
Everything it removes goes to the Trash, so nothing is gone until you empty the Trash. Diskzy is free for 72 hours with everything unlocked, then $9 once for 2 Macs.
Common questions
- Is it safe to delete everything in ~/Library/Caches?
- Yes, as long as the apps that own the files are closed. Apps rebuild what they need. Delete the contents of the folders, not the Caches folder itself, and expect slower first launches.
- Does clearing the cache delete my passwords or files?
- No. Caches hold copies of data that can be fetched again. Passwords are in your keychain or browser profile, and your documents are elsewhere. In a browser, cookies are a separate option from the cache, and removing cookies is what signs you out.
- How often should I clear the cache on my Mac?
- There is no schedule worth following. Clear caches when you need the space or when an app is misbehaving. macOS and most apps manage their caches without help.
- Why did my cache grow back after I cleared it?
- Because apps recreate what they use. That is the cache doing its job. Only data for apps and sites you no longer use stays gone.
- Will clearing the cache make my Mac faster?
- Usually not. It can fix a specific problem caused by a damaged cache, and it frees space, but the Mac is slower for a short while as caches are rebuilt.
Related guides
- Caches~/Library/Caches
- Google Chrome cache~/Library/Caches/Google/Chrome
- Safari cache~/Library/Containers/com.apple.Safari/Data/Library/Caches
- /private/var/folders/private/var/folders
- .cache~/.cache
Uninstall guides
See where your Mac's space went
Diskzy maps your disk, explains System Data and clears what's safe. Free for 72 hours, then $9 once for 2 Macs.
Try Diskzy for free