Cache is a small store of recently used data kept close at hand so your device, browser or website can load things faster the next time. This guide explains every common type of cache, what clearing it really does, and the exact steps to clear each one.
What is cache?
Cache (pronounced “cash”) is a temporary storage area that keeps copies of data you or your system have used recently. The next time that data is needed, it can be fetched from the cache instead of being downloaded or recalculated from scratch. It trades a little storage space for a lot of speed.
Think of it as keeping your most-used tools on the workbench instead of walking to the shed each time. The shed (the original source) still holds everything, but the workbench (the cache) saves you the trip.
Every cache follows the same basic routine:
- Something asks for data, such as a web page, an image or a calculation result.
- The system checks the cache first. If the data is there, that is a cache hit and it is served almost instantly.
- If it is not there, that is a cache miss. The data is fetched from the slower original source and a copy is saved in the cache for next time.
Caches are small and temporary by design. When they fill up, older or less-used items are pushed out, and many items carry an expiry time after which they are treated as stale.
What is a cache on a computer or a phone?
On a computer or phone, caching happens at several layers at once. Your web browser keeps copies of images and scripts from sites you visit. Your apps store thumbnails, downloaded files and other temporary data. Your operating system remembers recent DNS lookups and keeps recently read files in spare memory. Even the processor chip has its own tiny, extremely fast cache built in.
Together these layers are why a site you visit daily loads faster than one you have never seen, and why an app reopens quicker the second time. They also explain why “clearing the cache” can mean several different things, which the rest of this guide breaks down.
Types of cache at a glance
There are six common types of cache. They differ in where they live and, most importantly, in who is able to clear them.
| Type | What it stores | Where it lives | Who clears it |
|---|---|---|---|
| Browser cache | Page files such as images, CSS and JavaScript | Your browser, on your device’s storage | You, in browser settings |
| DNS cache | Website names matched to their IP addresses | Your operating system, browser and router | You (a short command), or a router restart |
| CDN cache | Copies of a website’s files on servers around the world | The CDN provider’s edge servers | The website owner, from the CDN dashboard |
| App cache | Thumbnails, temporary files and offline data | Each app’s storage on your phone or computer | You, in phone or app settings |
| CPU cache | The instructions and data the processor is using right now | Inside the processor chip (L1, L2, L3) | Hardware, automatically; you cannot clear it |
| RAM cache | Recently read files and data kept in spare memory | System memory (RAM) | The operating system, automatically |
What does clear cache mean, and what happens when you do it?
Clearing cache means deleting the temporary copies a browser, app or system has saved, so fresh copies are fetched from the original source the next time they are needed. It removes the shortcuts, not the originals.
What does clear cache mean?
When you clear a cache, the stored copies of files, images, lookups or temporary data are wiped. Nothing is lost permanently, because the source of that data (the website, the app’s servers or your own files) still has it. Your device simply has to fetch it again.
What happens when you clear cache?
- Things load more slowly at first. Pages, images and apps have to be downloaded again, then speed returns as the cache refills.
- Stale or broken content is often fixed. Old versions of pages, layout glitches and “it works on my other device” problems frequently disappear.
- Storage space is freed. Depending on how long it has built up, that can be anywhere from a few megabytes to several gigabytes.
- Your personal files are safe. Passwords, bookmarks, photos, documents and messages are not deleted by clearing cache alone.
- You stay signed in, unless you also clear cookies. Logins and saved preferences live in cookies, which browsers usually list as a separate tick box.
Cache is often confused with two other things in the same menu:
| Item | What it is | What clearing it does |
|---|---|---|
| Cache | Saved copies of site or app files | Slower first load; nothing personal is lost |
| Cookies | Small files that remember who you are, such as logins and carts | Signs you out and resets site preferences |
| Browsing history | A list of pages you have visited | Removes the list; has no effect on speed |
What is a browser cache?
A browser cache is a store of website files that your web browser (Chrome, Edge, Firefox, Safari and others) saves on your device the first time you visit a page, so it does not have to download them again on your next visit.
The cache typically holds images, logos, CSS stylesheets, JavaScript files and fonts. These files rarely change, but they make up most of the data a page needs, so reusing them saves a lot of time.
The website tells your browser how long each file can be reused, using instructions in its response called cache headers (for example, Cache-Control). When a file expires, the browser checks with the server whether it has changed. If it has not, the saved copy is used; if it has, the new version is downloaded.
The benefits are faster page loads, lower data use and less strain on the website’s servers. The downside is that you can occasionally see an outdated version of a page after the site has been updated, until the old copy expires or you clear it.
How to clear browser cache
In most desktop browsers the fastest route is Ctrl + Shift + Delete (Cmd + Shift + Delete on a Mac), which opens the clear browsing data panel. Choose the cached files option, pick a time range and confirm. Menu wording shifts between versions, but the option is always named something like “cached images and files”.
Google Chrome
- Click the three-dot menu, then Delete browsing data.
- Set the Time range. Choose All time to clear everything.
- Tick Cached images and files. Untick Cookies and other site data if you want to stay signed in to your accounts.
- Click Delete data.
Microsoft Edge
- Click the three-dot menu, then Settings > Privacy, search, and services.
- Under Clear browsing data, click Choose what to clear.
- Set the time range, tick Cached images and files, then click Clear now.
Mozilla Firefox
- Open the menu, then Settings > Privacy & Security.
- Under Cookies and Site Data, click Clear Data.
- Tick Cached Web Content (untick Cookies and Site Data to stay signed in), then click Clear.
Safari on a Mac
Safari has no single “cached files” box in its privacy panel, so the cleanest method is the Develop menu:
- Go to Safari > Settings > Advanced and tick Show features for web developers (older versions say Show Develop menu in menu bar).
- Open the Develop menu and choose Empty Caches (Option + Cmd + E).
Alternatively, Safari > Clear History removes the cache along with your history and cookies.
On a phone or tablet
- Chrome on Android or iPhone: open the menu, choose Delete browsing data, tick Cached images and files, then confirm. On Android, open the Advanced tab first.
- Safari on iPhone or iPad: go to Settings > Apps > Safari > Clear History and Website Data (on iOS 17 and earlier: Settings > Safari). This also removes cookies and history, because Safari does not offer cache on its own.
How to clear cache for a specific website
Clearing the cache for one site is the right move when a single page looks out of date or broken and you do not want every other site to load slowly while its cache rebuilds.
Quick fix: a hard refresh
A hard refresh reloads the current page and ignores the saved copies of its files, without deleting anything else.
- Windows or Linux (Chrome, Edge, Firefox): Ctrl + F5 or Ctrl + Shift + R
- Mac (Chrome, Edge, Firefox): Cmd + Shift + R
- Safari: hold Shift and click the Reload button
Chrome and Edge
- Keeps you signed in: open the developer tools (F12, or Cmd + Option + I on a Mac), then right-click the Reload button and choose Empty Cache and Hard Reload. The developer tools must stay open while you do this.
- Clears everything for the site: click the icon at the left of the address bar, choose Site settings, then Clear data. This removes the site’s cookies too, so you will be signed out.
Firefox
- Go to Settings > Privacy & Security.
- Under Cookies and Site Data, click Manage Data.
- Search for the website, select it, click Remove Selected, then Save Changes.
Safari
- Mac: go to Safari > Settings > Privacy > Manage Website Data, search for the site and click Remove.
- iPhone or iPad: go to Settings > Apps > Safari > Advanced > Website Data, search for the site and delete it.
Still seeing the old version?
Open the page in a private or incognito window, which starts with no saved files for the site. If it looks correct there, your browser cache was the cause. If it still looks wrong, the old content is probably coming from another layer, such as a DNS cache or a CDN cache, or the site itself has not been updated.
What is a DNS cache?
A DNS cache is a temporary record of recent domain name lookups, kept so your device does not have to ask a DNS server every time you visit a website.
DNS, the Domain Name System, works like the internet’s phone book. It translates a name you can remember, such as example.com, into the numeric IP address that computers use to find each other. Without caching, every page, image and video link would trigger a fresh lookup first.
DNS answers are cached at several levels: in your web browser, in your operating system, in your router, and on the DNS server run by your internet provider or a public service such as Google (8.8.8.8) or Cloudflare (1.1.1.1). Each entry expires after a time set by the website’s DNS record, known as its TTL (time to live), which can range from seconds to many hours.
A DNS cache makes browsing faster, but it can cause trouble when a website moves to a new server. Your device may keep sending you to the old address, which shows up as a “site can’t be reached” error or an outdated version of the site. A corrupted or tampered entry can also send you to the wrong place, which is another reason to flush the cache when something looks off.
How to clear DNS cache
Flushing the DNS cache takes a few seconds, deletes no personal data, and is the usual fix for errors that appear after a website moves to a new server.
Windows 10 and 11
- Click Start, type
cmd, and open Command Prompt. - Type the command below and press Enter.
- Wait for the message “Successfully flushed the DNS Resolver Cache.”
ipconfig /flushdns macOS
Open Terminal (in Applications > Utilities), paste the command below, press Enter and type your Mac password when asked. There is no confirmation message when it works.
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder Linux
The command depends on which resolver your system uses. Most modern desktop distributions use systemd-resolved:
sudo resolvectl flush-caches If you use dnsmasq or nscd instead, restart that service, for example sudo systemctl restart dnsmasq.
Chrome and Edge’s own DNS cache
Browsers keep a DNS cache of their own, separate from the operating system. In Chrome, enter chrome://net-internals/#dns in the address bar and click Clear host cache. In Edge, use edge://net-internals/#dns. For Firefox, closing and reopening the browser clears it.
Android and iPhone
Phones have no flush command. Turn Airplane mode on for about ten seconds and then off, or restart the device.
Your router
Most routers keep a DNS cache too. Unplug the router for 30 seconds and plug it back in.
If a website’s owner changed its DNS records recently, your internet provider’s DNS server may still hold the old answer. Flushing your own device cannot override that, and the change can take up to 24 to 48 hours to reach everyone.
What is a CDN cache?
A CDN cache is the set of website files stored on the servers of a content delivery network (CDN), so visitors receive them from a server near them instead of from the website’s own server, which may be on the other side of the world.
A CDN is a network of servers, called edge servers or points of presence, spread across many countries. Well-known providers include Cloudflare, Amazon CloudFront, Fastly and Akamai.
Here is how it works for a visitor in Auckland:
- The visitor requests a page or image.
- The request goes to the nearest edge server rather than the website’s main (origin) server.
- If the edge server holds a fresh copy, it sends it straight back. If not, it fetches the file from the origin, sends it on and keeps a copy for the next visitor.
CDNs mostly cache static files such as images, stylesheets, scripts, fonts and video, and many can cache whole pages too. The result is faster loading for distant visitors, less load on the origin server and better resilience during traffic spikes.
The catch is that after a website is updated, the CDN may keep serving the old version until its copy expires or is cleared. Unlike your browser cache, a CDN cache is controlled by the website owner, not by the visitor.
How to clear CDN cache
Visitors cannot clear a CDN cache. Only the website owner or developer can, by purging (also called invalidating) the cached files from the CDN provider’s dashboard. If you are a visitor and a site looks out of date, try a hard refresh and let the site owner know.
Purge from the CDN dashboard
The exact labels vary by provider, but the process is the same: sign in, find the caching section, and choose to purge everything or only specific files.
- Cloudflare: select your site, go to Caching > Configuration > Purge Cache, then choose Purge Everything or Custom Purge and enter the URLs.
- Amazon CloudFront: open your distribution, go to the Invalidations tab, click Create invalidation and enter paths such as
/images/logo.pngor/*for everything. - Fastly: use the Purge options on your service to purge a single URL, a group of files by key, or everything.
- WordPress and other CMS platforms: most caching and CDN plugins add a Purge cache button to the admin area or toolbar.
Purges usually take effect within seconds to a few minutes, depending on the provider.
Purge only what changed
Purging everything forces every edge server to refetch every file from the origin, which can slow the site and spike server load while the cache refills. When only one page or image changed, purge just that URL.
Stop stale content before it happens
- Version your files. Names such as
style.v2.cssorapp.8f3a1.jsmake an updated file look brand new to every cache, a technique called cache busting. - Set sensible cache headers. Short lifetimes suit HTML pages that change often; long lifetimes suit versioned images, scripts and styles.
- Purge automatically on publish. Many CDNs and CMS plugins can clear the right URLs whenever content is updated.
A CDN purge does not clear the copies already saved in visitors’ browsers. To check your changes, open the site in a private window or do a hard refresh.
What is an app cache?
An app cache is the temporary data a phone or computer app saves on your device so it can open faster, scroll smoothly and cope with a patchy connection.
What gets stored depends on the app. A social media app keeps images and videos you have scrolled past. A maps app saves map tiles for areas you have viewed. A music or video app holds recently streamed pieces, and a messaging app keeps media thumbnails and previews. Games and productivity apps store downloaded assets and temporary working files.
App cache is different from app data. Cache is disposable and rebuilds itself automatically. App data is the information the app needs to function, such as your account, settings and any files or downloads you chose to keep. Android lists the two separately in each app’s storage screen, which matters because clearing one is harmless and clearing the other resets the app.
Left alone, app cache can grow to hundreds of megabytes or even several gigabytes, with social media, streaming and browser apps usually the biggest contributors.
How to clear app cache
How you clear an app’s cache depends on your device. Android makes it easy, iPhone does not offer a direct button, and computers vary by app.
Android
- Open Settings > Apps and tap the app you want to clean up.
- Tap Storage (on some phones, Storage & cache).
- Tap Clear cache.
Avoid Clear data or Clear storage unless you want to reset the app, because that deletes its settings, logins and offline files. Stock Android no longer has a one-tap “clear all cache” button, so this is done app by app. Some manufacturers add a cleaner to their device care or maintenance menu.
iPhone and iPad
iOS does not let you clear one app’s cache from Settings. You have three options:
- Use the app’s own setting. Many apps include a clear cache option, such as Spotify (Settings > Storage) and Telegram (Settings > Data and Storage > Storage Usage).
- Offload the app. Go to Settings > General > iPhone Storage, tap the app, choose Offload App, then Reinstall App. This clears temporary files but keeps your documents and data.
- Delete and reinstall. This removes the cache and all app data, so make sure anything important is backed up and you know your login details.
For Safari, see the browser cache section above.
Windows
- Temporary files: go to Settings > System > Storage > Temporary files, tick the items to remove and click Remove files.
- Microsoft Store cache: press Windows + R, type
wsreset.exeand press Enter. A blank window opens and the Store reopens when it is done. - Desktop apps such as Teams, Slack or Spotify: look for a clear cache option in the app’s own settings first.
Mac
First check whether the app has its own clear cache option. If not, quit the app, then in Finder choose Go > Go to Folder, enter ~/Library/Caches, open the folder named after the app and delete its contents, leaving the folder itself in place. Leave system folders alone, and restart the app afterwards.
What is a CPU cache?
A CPU cache is a very small, very fast memory built into the processor chip itself. It holds the instructions and data the processor is using or is about to need, so it does not have to wait for the much slower main memory (RAM).
CPU cache is made from a fast type of memory called SRAM that sits right beside the processor cores. It is far quicker than RAM but also much more expensive and bulky, which is why it is measured in megabytes rather than gigabytes. The processor guesses what it will need next, based on what it used recently and what sits nearby in memory, and loads it into the cache ahead of time.
CPU cache is organised in levels. The figures below are typical ranges for modern processors, and the speeds are approximate.
| Level | Typical size | Relative speed | Shared? |
|---|---|---|---|
| L1 | Tens of KB per core | Fastest, a few CPU cycles | Private to each core |
| L2 | Hundreds of KB to a few MB | Fast, roughly 10 to 15 cycles | Usually per core |
| L3 | Several MB to over 100 MB | Slower, roughly 30 to 70 cycles | Shared by all cores |
| RAM (for comparison) | Gigabytes | Hundreds of cycles | Whole system |
A bigger or smarter cache can noticeably improve performance in games, video editing and other demanding work, which is why cache size appears on processor spec sheets.
Can you clear a CPU cache?
No, and there is nothing to gain from trying. The processor manages its own cache automatically, constantly filling it and discarding old entries, and its contents disappear whenever the computer powers off. Restarting the computer is the only practical way to start with an empty CPU cache.
How to clear RAM cache
You rarely need to clear RAM cache, because your operating system does it for you. The simplest way to clear it manually is to restart the computer.
What is RAM cache?
RAM cache is spare memory that the operating system uses to keep recently read files and data close at hand, so they do not have to be fetched from the slower storage drive again. You will see it labelled Cached in Windows Task Manager, Cached Files in macOS Activity Monitor and buff/cache in Linux.
This memory is released the moment an app needs it, so a large cache is not a sign of a problem. Unused RAM is wasted RAM, and clearing the cache usually makes things slightly slower until the cache fills again.
Windows
- Press Ctrl + Shift + Esc to open Task Manager, then open the Performance tab and select Memory to see how much is cached.
- The easiest way to clear it is to restart your PC.
- For troubleshooting, Microsoft’s free RAMMap tool (from Sysinternals) has an Empty menu with an Empty Standby List option.
macOS
Open Activity Monitor and select the Memory tab to see cached files. Restarting clears it. To clear the disk cache without restarting, open Terminal and run:
sudo purge Linux
Check usage with free -h. To drop the page cache, run the command below. The sync part saves any unwritten data to disk first, and the 3 clears both the page cache and the directory and file entry caches.
sync; echo 3 | sudo tee /proc/sys/vm/drop_caches Android and iPhone
Both systems manage memory automatically. Restarting the device is the reliable way to clear it. Force-closing apps rarely helps and can make your phone slower, because the apps have to reload from scratch.
When should you clear cache, and when should you leave it alone?
Clear a cache to fix a specific problem, not as routine housekeeping. A healthy cache is doing its job by making things faster.
Good reasons to clear cache
- A website looks broken, shows old content or will not let you sign in properly.
- A page works in a private window but not in your normal browser.
- An app keeps crashing, freezing or showing out-of-date information.
- Your phone or computer is almost out of storage.
- One website will not load while others work fine (flush the DNS cache).
Reasons to leave it alone
- Everything is working well. There is nothing to fix.
- You are on slow or metered mobile data, because cleared files must be downloaded again.
- You want to “speed up” your device. Clearing browser or RAM cache regularly tends to make things slower, not faster.
- You are not sure what a Clear data or Cookies option will delete. Check first, because those can sign you out or remove offline files.
A sensible order to troubleshoot
Work from the smallest fix to the largest and stop as soon as the problem is solved:
- Do a hard refresh of the page.
- Try the page in a private or incognito window.
- Clear the cache for that one website.
- Clear your browser cache.
- Flush the DNS cache.
- Restart the browser, then the device.
- If it is still wrong on every device, the problem is on the website’s side, such as an unpurged CDN cache, and the site owner needs to fix it.
Frequently asked questions
Is it safe to clear cache?
Yes. Cache holds temporary copies only, and the originals stay on the website, the app’s servers or your own storage. The only cost is that things load a little slower the first time afterwards.
Does clearing cache delete my passwords, photos or bookmarks?
No. Those are stored separately. In a browser they are deleted only if you also tick options such as saved passwords, autofill data or bookmarks, which are not part of the cache.
Will clearing cache log me out of websites?
Not on its own. Logins are kept in cookies, so you are signed out only if you clear cookies and site data as well.
How often should I clear cache?
There is no schedule to follow. Clear it when you have a problem it can fix, or when you need the storage space.
Does clearing cache make a computer or phone faster?
Usually not. It can free up storage, which helps a device that is nearly full, but the cache rebuilds itself and the device is slightly slower until it does.
Is clearing cache the same as clearing history?
No. History is the list of pages you have visited, while cache is the saved files that make those pages load faster. Browsers let you clear them separately.
What is the difference between cache and cookies?
Cache stores files so pages load quickly. Cookies store small pieces of information about you, such as whether you are logged in or what is in your shopping cart.
