“Have you tried clearing your cache?” is the most repeated advice in technology, and most people follow it without knowing what they just deleted. Will you be logged out? Will you lose passwords? Does it make anything faster? This guide answers each of those questions with real examples, and shows the layers of caching you never knew existed.
The advice everyone gives and nobody explains
I have lost count of how many times, during years of supporting websites and teams, I have typed the sentence “try clearing your cache.” It works often enough that it has become a ritual, like switching a device off and on again. But rituals without understanding cause trouble. People clear everything, lose their saved logins, and then complain that the fix “broke” something. Others never clear anything and wonder why a website still looks like last year’s version.
The truth is that “the cache” is not one thing. There are many caches, living in different places, owned by different people. When someone says clear it, they might mean your browser, your phone app, your computer’s address book, a content delivery network, or a plugin on a web server. Knowing which one is the difference between a ten-second fix and an hour of confusion.
The one-sentence version. A cache is a temporary stored copy of something that was slow to fetch, kept so the next request is fast. Clearing it deletes those copies, which gets them re-downloaded fresh. It does not delete your passwords or bookmarks, and it normally does not log you out.
A cache in everyday life
Before the computer version, think of a kitchen. You could walk to the shop every time you need salt. Instead, you keep a small jar on the counter. Fetching from the jar takes a second, going to the shop takes twenty minutes. The jar is a cache.
It has the same properties as every digital cache. It is small, so it can only hold what you use often. It is a copy, so the shop still has the real thing. And it can go stale: if the shop changes the recipe on the salt, your jar still holds the old version until you refill it.
That last point is the source of nearly all cache problems. A cache is fast because it trusts old copies, and it is annoying when the trust is misplaced.
Why caches exist: speed, in numbers
Computers have a hierarchy of storage. Closer to the processor means faster and smaller, further away means slower and bigger. As a rough scale (these are order-of-magnitude figures that vary by machine), reading from the CPU’s own cache takes about a nanosecond, from main memory about a hundred nanoseconds, from a solid-state drive around a hundred microseconds, and from a server across the internet tens of milliseconds. That is a gap of millions of times between the fastest and slowest layers.
Caching exploits that gap. The system keeps copies of frequently used things closer, so it can skip the slow trip. A simple calculation shows how much this matters. Suppose a cache hit takes 5 milliseconds and a miss, which means going to the original source, takes 200 milliseconds.
With no cache at all, every request waits 200 ms. If 85% of requests are hits, the average wait drops to 0.85 × 5 + 0.15 × 200 = 34.25 ms, nearly six times faster. At a 95% hit rate it is under 15 ms. The curve is a straight line, so every additional percent of hits is worth the same amount. That is why companies spend real money on caching.
The layers: who is caching what
This is the part most guides skip. Between you and a website, copies are stored in at least five different places.
- CPU cache: tiny, ultra-fast memory built into the processor. It manages itself and you cannot clear it.
- Browser cache: your browser saves images, stylesheets, scripts and fonts so repeat visits are quick. This is what “clear cache” normally refers to.
- Operating system and DNS cache: your computer remembers which numeric address belongs to a website name so it does not ask again every time.
- CDN cache: a content delivery network keeps copies of site files on servers around the world, close to visitors.
- Server cache: the website itself may save ready-made versions of pages, so it does not rebuild them for each visitor.
A reader can clear only the second and third. The last two belong to whoever runs the site. If you publish websites yourself, as many of my readers do, you will deal with all five.
What your browser cache actually contains
Open any web page and your browser downloads a bundle of files: the page itself (HTML), stylesheets (CSS) that control appearance, scripts (JavaScript) that add behaviour, images, and fonts. Many of these rarely change. The logo on a site is the same on every page, so downloading it fresh each time would be wasteful.
The browser therefore stores these files, and the next time it needs them it can skip the download. Here is what that looks like for a typical page, using realistic but illustrative sizes.
On a first visit this example page downloads 1,850 KB. On a repeat visit, only the 60 KB HTML needs to be fetched, a saving of about 97%. At a typical home connection of 10 Mbps, the first load needs about 1.5 seconds of transfer while the repeat takes a fraction of that. On a slow 2 Mbps mobile connection, the first visit would need around 7.4 seconds of transfer alone, which is exactly why the cache matters so much on phones.
How the browser decides whether to trust its copy
A cache that never refreshed would show you stale pages forever. So websites send instructions, in hidden headers, telling the browser how long a file stays fresh. A typical header says something like Cache-Control: max-age=86400, which means “this file is good for 24 hours.” Within that window, the browser uses its copy without even asking.
When a file goes stale, the browser does not always download it again. It can ask the server a cheaper question: “I have the version labelled with this tag. Has it changed?” The label is called an ETag. If the answer is no, the server replies with a tiny “304 Not Modified” message and the browser keeps using its copy. Only if the file changed does the server send the full new version.
Developers also use a trick called cache busting. When they update a stylesheet, they change its name or add a version number, for example style.css?v=42, so that the browser sees a brand-new file and fetches it. When this is forgotten, you get the classic symptom: new page, old styling.
Cache, cookies and history: the three things people confuse
This is where most of the damage and most of the fear come from. The “clear browsing data” screen in a browser lists several separate items. They are different things.
| Item | What it holds | Logs you out? | Safe to clear? |
|---|---|---|---|
| Cached images and files | Copies of site files for speed | No | Yes. Sites just reload slower once. |
| Cookies and site data | Login tokens, preferences, carts | Yes, usually | Yes, but expect to sign in again. |
| Browsing history | List of pages you visited | No | Yes. Autocomplete suggestions shrink. |
| Saved passwords | Credentials your browser stores | No | Careful. Make sure you know them first. |
| Autofill data | Addresses and cards you saved | No | Careful. You will have to retype them. |
The practical rule: if you only tick “cached images and files,” you will not lose logins or passwords. The mistakes happen when people press the big “clear all” button and tick every box. A moment of care is worth saving yourself a password-reset afternoon.
Five situations, five different fixes
Tap through the tabs. Each one shows a real problem and which layer to clear.
Site looks broken
A website was redesigned overnight, but on your screen the layout looks scrambled: new content with the old styling.
Windows / Linux: Ctrl + Shift + R (or Ctrl + F5)
macOS: Cmd + Shift + RWhat is going on. Your browser kept the old stylesheet and is pairing it with the new page. A hard refresh asks for fresh copies of everything on this page only. If that fails, clear “cached images and files” for the site. No logins are lost, because cookies are a separate item.
Phone storage full
Your phone says storage is almost full and a social app is using 3 GB.
Android: Settings > Apps > [app] > Storage > Clear cache
# Clear data / Clear storage also resets the app and signs you outWhat is going on. App caches hold thumbnails, videos and temporary files that the app can fetch again. Clearing the cache frees space with little downside, while clearing data wipes settings and logins. iPhones do not offer a per-app cache button, so people offload or reinstall the app instead.
Login problems
A website keeps looping you back to the login page, even though your password is correct.
Chrome: lock icon > Site settings > Delete data
# or Settings > Privacy > Delete browsing data > CookiesWhat is going on. Sign-in problems are normally about cookies, not cache. Cookies hold the small token that says “this browser is logged in.” A damaged or outdated cookie confuses the site. Clearing cookies for that site fixes it, and you simply sign in again.
Site not loading
A website moved to a new server, and your computer still tries the old address while friends can open it fine.
# Windows
ipconfig /flushdns
# macOS
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponderWhat is going on. Your operating system remembers which address belongs to a domain name for a while, to avoid repeating the lookup. Flushing that DNS cache forces a fresh lookup. It has nothing to do with your browser’s stored images.
You edited a post
You updated a WordPress article, but visitors (and you, logged out) still see the old version.
1. Save or update the post
2. Purge the page cache in your caching plugin
3. Purge the CDN cache (for example Cloudflare: Caching > Purge)
4. Hard refresh your browser
5. Test in a private windowWhat is going on. Site owners have more layers than readers. The plugin keeps ready-made pages, the CDN keeps copies near visitors, and every browser keeps its own. Work from the origin outward: plugin, then CDN, then your own browser, and check in a private window to avoid your own stale copy.
Notice that “clear the cache” was the right answer in only two of those five situations. In the others, the fix involved cookies, DNS, or the layers a site owner controls. That is the lesson of this whole article: ask which cache before you clear.
Hard refresh versus clearing everything
If a single website looks wrong, you rarely need to clear your entire browser cache. A hard refresh bypasses the cached copies for that page. On Windows and Linux you press Ctrl+Shift+R (or Ctrl+F5), and on a Mac, Cmd+Shift+R. It is the scalpel; clearing the whole cache is the sledgehammer.
Another trick I use constantly is the private or incognito window. It starts with no stored cache or cookies for that session, so if the site looks right there, you know the problem is a stale copy in your regular browser. If it looks wrong there too, the problem is not your cache at all: it is the server, the CDN, or the site itself.
If you run a website: the layers pile up
Readers have one cache to worry about. Site owners have several, and that is why “I updated it but it did not change” is such a common complaint. Imagine you fix a typo in a WordPress post and click Update.
- The page cache plugin may keep serving the pre-built old page until it is purged.
- The CDN may keep serving its copy from servers near your visitors until its rules expire or you purge it.
- Each visitor’s browser may keep its own copy until it is stale.
The order matters. Clear from the source outward: plugin first, then CDN, then your own browser. If you clear the browser first, it simply re-downloads the stale copy from the layer above it. And always verify in a private window, because your own normal window is the layer most likely to mislead you.
The same thinking applies to design changes. Many themes and plugins also bundle CSS and JavaScript files. If a style tweak does not show, purge the plugin’s file cache, and then purge the CDN. A teammate of mine once spent a whole morning editing a stylesheet that was working perfectly; the browser was just refusing to fetch it.
Mobile phones: cache versus data
Apps cache aggressively. A social app saves thumbnails and video chunks so scrolling feels smooth, and over months this can grow into gigabytes. On Android, you can open the app’s storage screen and choose to clear the cache, which frees space and costs you nothing but a slightly slower first scroll afterward.
The same screen has a second button, usually called “Clear data” or “Clear storage.” This one is different and more drastic: it resets the app, signing you out and removing settings and sometimes locally stored files. People hit the wrong button all the time. Read the label twice.
On iPhone there is no per-app cache button. Options are to offload the app, which keeps its documents but removes the app files, or to delete and reinstall it. Safari has its own setting to clear history and website data, which removes the browsing history, cookies and cached files together.
When clearing the cache is a bad idea
- Doing it daily out of habit. You throw away the speed benefits and re-download everything again and again.
- Doing it on a metered connection. Re-downloading a heavy site’s files uses your data allowance.
- Believing it protects your privacy. Cache is a small part of what sites know about you. Cookies, accounts and network logs are separate.
- Using it as a cure for everything. Slow internet, a failing disk and an overloaded server will not improve.
Six myths about clearing cache (tap to open)
1. “Clearing cache deletes my passwords”
It does not. Passwords are stored separately. Only if you tick the password box in a “clear all” screen do they go.
2. “Clearing cache logs me out of everything”
Logins usually live in cookies. Clearing only cached images and files does not touch them.
3. “A bigger cache means a slower computer”
Not directly. A cache is designed to speed things up. A full phone with no free storage can struggle, though, so freeing space helps there.
4. “Clearing cache removes viruses”
No. Malware is a different problem and needs security software, not a cache clear.
5. “Private browsing never uses a cache”
It uses a temporary one that is discarded when you close the window. That is why it is useful for testing.
6. “If I clear my cache, the website is updated”
Only your own copy is refreshed. If the site’s server or CDN is serving old content, you will still see it.
Quick quiz: test yourself
Tap each question to reveal the answer and the reasoning.
What is a cache?
- A password manager
- A temporary stored copy that saves re-fetching or recomputing
- A type of virus
- A backup of your whole phone
A cache keeps a nearby copy of something expensive to get, so the next request is faster.
Will clearing your browser cache normally log you out of websites?
- No, logins live mostly in cookies
- Yes, always
- Only on Fridays
- Only on mobile
Cached images and files are separate from cookies. Clear cookies and site data, not cache, to be signed out.
A site you manage looks old after an update, even after you cleared your browser cache. Which other layers might be stale?
- Your keyboard
- The monitor
- Plugin, CDN or server page cache
- Nothing else
Site owners often have a page-cache plugin and a CDN, each holding its own copy. Purge from the origin outward.
What does a hard refresh do?
- Deletes your history
- Restarts the computer
- Signs you out
- Reloads the page while bypassing the cached copies for that page
It asks the server for fresh versions of the page’s files, without wiping your whole cache.
Which clear-data option on Android can sign you out of an app?
- Clear cache
- Clear data or storage
- Force stop
- Update
Clear data wipes the app’s stored data, including logins and settings.
Frequently asked questions
What does clearing cache actually do?
It deletes the saved copies of files, such as images, scripts and stylesheets, so they are downloaded fresh next time. It does not delete your passwords, bookmarks or, normally, your logins.
Is it safe to clear cache?
Yes. Nothing important is lost, because a cache only holds copies. The downside is that the next visits may load slower while the files are downloaded again.
What is the difference between cache and cookies?
Cache stores files to make pages load faster. Cookies store small pieces of data about you, such as a login token or preferences. Clearing cookies can sign you out; clearing cache usually will not.
How often should I clear my cache?
There is no schedule. Do it when a site looks outdated or broken, when something misbehaves, or when you need to free space. Clearing it daily just makes browsing slower.
Does clearing cache make my computer faster?
Not really. A cache exists to make things faster, so wiping it often does the opposite for a while. It helps only when the cache is corrupted or when low storage is the bottleneck.
What is cache invalidation?
It is deciding when a stored copy is no longer valid and must be replaced. It is famously difficult, and the engineer Phil Karlton is often quoted as saying that cache invalidation and naming things are the two hard problems in computer science.
The takeaway
Clearing the cache deletes saved copies, nothing more. Your passwords, bookmarks and, normally, your logins survive. The real skill is knowing which cache is misbehaving: your browser, your phone app, your computer’s DNS memory, or a layer owned by the website.
Next time something looks stale, start small: hard refresh, then a private window, then clear cached files for that site. Reach for the big clear-everything button last, and read each checkbox before you press it.
