Guide · Mac
How to clear cache on Mac
Caches are the copies your apps and browsers keep so they don't have to fetch the same things twice. Here is how to clear them on a Mac, app by app and browser by browser, and when it's better to leave them alone.
The short answer
To clear cache on a Mac, empty the app folders inside ~/Library/Caches, then clear each browser's cache from inside the browser. Apps and websites rebuild what they need as you use them.
- Quit the apps whose cache you want to clear.
- In Finder, press Shift-Command-G, go to ~/Library/Caches and move what's inside the biggest app folders to the Trash.
- In Safari, turn on Show features for web developers in Settings > Advanced, then choose Develop > Empty Caches.
- In Chrome, Firefox or Edge, press Shift-Command-Delete and clear only the cached files.
- Empty the Trash to get the space back.
What is cache on a Mac?
A cache is a set of files an app keeps so it doesn't have to download or work out the same thing twice. Your browser saves images and scripts from the sites you visit. Other apps keep thumbnails, previews and content they've downloaded. Next time, the app reads its own copy instead of starting over. That's the whole point of a cache: to make things faster.
On a Mac, caches live in a few places:
- Your app caches, in
~/Library/Caches. This is the folder people mean when they talk about clearing cache on a Mac, and you can clear it app by app. - Browser caches. Each browser manages its own, and the cleanest way to clear one is from inside the browser.
- The DNS cache, where macOS remembers recent lookups of which address each website lives at. Clearing it frees no space, but it can fix sites that won't load.
- System caches in
/Library/Cachesand/System, which belong to macOS.
The ~ stands for your home folder. Your Library folder is hidden in Finder, which is why the steps below use Go to Folder.
How to clear app caches in ~/Library/Caches
- Quit the apps whose caches you want to clear. A running app can write files straight back, or trip over the ones that vanish.
- In Finder, choose Go > Go to Folder, or press Shift Command G.
- Type
~/Library/Cachesand press Return. - To see how big a folder is, select it and press Command I to open its Get Info window.
- Open the folder of an app taking a lot of space, select everything inside it, and press Command Delete to move it to the Trash. Leave the app's folder, and the Caches folder itself, in place.
- When you're done, choose Finder > Empty Trash, or press Shift Command Delete.
Most folders are named after the app or its maker, often written back to front like com.maker.appname. If you don't recognize one, leave it. If a folder won't open or won't move, skip it too: macOS protects some of them.
The Trash is your undo. Until you empty it, you can get anything back: open the Trash, select the item and choose File > Put Back. If an app acts strangely after you clear its cache, do that before anything else.
How to clear browser cache on Mac
Browsers are where most people notice cache, and each one clears its own. Do it from inside the browser rather than deleting its folders by hand: the browser knows which files are cache and which are your history, cookies and passwords.
Clear the cache, not the cookies, to stay signed in. Cookies are what keep you signed in to websites. Every browser below lets you clear cached files on their own. Tick cookies too only if you're ready to sign in to every site again.
Clear the cache in Safari
Safari's cache command lives in the Develop menu, which is hidden until you turn it on.
- In Safari, choose Safari > Settings, then click Advanced.
- Turn on Show features for web developers. A Develop menu appears in the menu bar.
- Choose Develop > Empty Caches.
That clears Safari's caches only; history and cookies are separate steps, below. On older versions of Safari, the menu says Preferences and the box is called Show Develop menu in menu bar.
To clear history too, choose History > Clear History, pick how far back to go from the pop-up menu, and confirm. Safari removes the pages you've visited, recent searches, website icons, page snapshots and the list of downloads, though not the downloaded files. If your Mac uses iCloud for Safari, the history goes from your other Apple devices too.
To clear cookies and website data, choose Safari > Settings, click Privacy, then Manage Website Data. Select sites and click Remove, or click Remove All. Apple notes this may sign you out of websites, and can change or remove the same data in other apps.
Clear the cache in Chrome
- Click More (the three dots at the top right), then Delete browsing data. Or press Shift Command Delete.
- Choose a time range. All time clears everything.
- Tick Cached images and files. Untick Cookies and other site data if you want to stay signed in.
- Click Delete data.
Pages can load a little slower at first while Chrome downloads images and files again. If you sync Chrome, you stay signed in to the Google Account you sync with, and the data you delete is cleared on your other synced devices too.
Clear the cache in Firefox
- Click the menu button (the three lines at the top right), then History > Clear Recent History. Or press Shift Command Delete.
- Next to When, choose Everything.
- Tick Temporary cached files and pages, and untick everything you want to keep.
- Click Clear.
The same window opens from Firefox > Settings > Privacy and security: click Clear browsing data in the Browsing data section.
To clear the cache every time you quit, go to the History section of that panel, select Customize history and click Choose what you want Firefox to remember. Turn on Clear history when Firefox closes, click Settings, tick only Temporary cached files and pages, and click Save Changes.
Clear the cache in Edge
- Click Settings and more (the three dots at the top right), then Settings.
- Click Privacy, search, and services.
- Click Clear browsing data, then Choose what to clear.
- Pick a Time range, tick Cached images and files, and untick the rest.
- Click Clear now.
Shift Command Delete opens the same window. If sync is on, synced items are cleared on your other devices too.
Fixing one page? You may not need to clear anything. In Chrome, Firefox and Edge, Shift Command R reloads the page and skips the cache.
How to clear the DNS cache on Mac
The DNS cache is a different thing. It holds macOS's recent lookups of which address each website lives at. Clearing it frees no space, but it can help when a site has moved, loads for everyone but you, or still goes to the old place after you change your DNS settings.
Open Terminal, from Applications > Utilities or by pressing Command Space and typing Terminal. Paste this and press Return:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Type your Mac's password when asked; nothing shows as you type. If it works, Terminal prints nothing. The second half is the command Apple gives for OS X Yosemite 10.10.4 and later, which covers Ventura through Tahoe, and the first half flushes the directory service cache as well. Restarting your Mac clears the DNS cache too. If a site still won't load, quit and reopen your browser.
System caches: leave them to macOS
There are two more Caches folders outside your home folder, /Library/Caches and /System/Library/Caches. Leave both to macOS.
/Systemsits on a read-only volume that macOS protects, so you couldn't change it if you tried./Library/Cachesholds caches for macOS and for software shared by every account on your Mac. Most of what's inside belongs to the system, so removing it takes an administrator password, and removing the wrong thing can make an app or a system feature misbehave until it's rebuilt.
If you want system caches cleared, let macOS do it: start up in safe mode once. Apple says safe mode clears some system caches, including font caches and the kernel cache, which are created again as needed.
- Mac with Apple silicon: shut down, then press and hold the power button until you see Loading startup options. Select your startup disk, hold Shift and click Continue in Safe Mode.
- Intel-based Mac: turn on or restart your Mac and hold Shift until you see the login window.
To leave safe mode, restart normally. Apple adds that this can free up some space for a while, which can help when there isn't enough room to install a macOS update.
What clearing cache does, and what it doesn't
- It frees disk space, for a while. Caches grow back as you use your apps, so much of that space fills up again over time.
- It can fix glitches. A site that loads wrong or looks broken, or an app showing stale data, can come right once it fetches fresh copies. Google suggests clearing cache and cookies for loading and formatting problems on websites.
- Apps rebuild their caches. The first launch or page load afterwards can be slower while the app downloads or works out its files again.
- It doesn't speed up your Mac. Caches exist to make apps faster. Clearing them won't make your Mac faster, and for a short while apps and sites can be a little slower.
- Clearing only the cache keeps your data. Passwords, bookmarks, cookies and history are separate. Clear those only if you mean to.
When not to clear cache
- As a routine. Clearing cache every week mostly makes apps download the same files again. Do it when you need the space or something isn't working.
- On a slow or metered connection. Everything you clear has to come down again. Wait until you're on a good connection.
- When you can't easily sign in again. If your two-factor codes are on a phone that isn't with you, clear the cache only, not cookies.
- When you don't know what a folder is. In
~/Library/Caches, skip what you don't recognize, and stay out of/Library/Cachesand/System. - In the middle of a coding project. Xcode's DerivedData and package caches are caches too, but rebuilding them can take a long time. The developer caches guide covers them one by one.
The fast way: let Safai do it
Safai's Smart scan finds the junk for you: app caches in ~/Library/Caches, logs in ~/Library/Logs, Xcode DerivedData, npm, pnpm, Cargo and Go caches, and the Trash. Wash it all away clears it in one click, after showing you everything, biggest first. The Privacy screen clears browser junk, and every switch says what clearing it costs, so you stay signed in and your tabs stay open.
Nothing is deleted outright: everything waits in Safai Trash until you empty it, and you can put any of it back. Safai never touches git repositories, synced folders, keychains, backups or app bundles, and nothing leaves your computer.
$29.99 once with two years of updates, for Mac and Windows. No subscription, no account, no ads.
Get Safai, from $29.99Questions
Is it safe to clear cache on a Mac?
Yes, for your own app caches and your browser caches. Apps rebuild them as you use them, so the usual cost is a slower first launch or page load. Quit an app before clearing its cache, and leave the system caches in /Library/Caches and /System to macOS.
Will clearing cache sign me out of websites?
Not if you clear only the cache. Cookies are what keep you signed in, so leave cookies and site data unticked. Clearing only the cache does not remove saved passwords, bookmarks or history either.
Does clearing cache speed up a Mac?
No. It frees disk space and can fix an app or website that is misbehaving, but caches exist to make things faster. Right after you clear them, apps and pages can be a little slower while they rebuild.
How often should I clear cache on my Mac?
Only when you need the space or something is not working right. Clearing cache on a schedule mostly makes your apps download the same files again.
How do I clear the DNS cache on a Mac?
Open Terminal, run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder and type your Mac password when asked. Restarting your Mac clears the DNS cache too.
Where is the cache folder on a Mac?
Your app caches are in the Caches folder inside your Library folder, at ~/Library/Caches. Library is hidden in Finder, so press Shift-Command-G, type that path and press Return to open it.