Chrome WON'T clear cache... ctrl + F5 doesn't seem to work either

I'm working on a web project but I have this really annoying issue with my browser, Google Chrome... Every time I make changes on my website, my browser won't refresh and clear the cache. It works totally fine in my friend's Chrome browser, but not for me apparently.

As mentioned ctrl + F5 does not work for me. I tried to press F12 (for developer console) and right-click on the refresh icon, and then click "Empty Cache and Hard Reload". Still doesn't work... Actually not true, it worked once - but now it stays the same again... I tried reinstalling chrome too, still didn't work... I tried to clear my whole history including all passwords, cache and so on - but nothing has fixed the issue.

Edited on 02-05-2020: Some of your answers worked for me, but some time ago I found a Chrome extension that works really well for me and I wanted to share with the community. It is called "Clear Cache" and you can find it here:

https://chrome.google.com/webstore/detail/clear-cache/cppjkneekbjaeellbfkmgnhonkkjfpdn/RK%3D2/RS%3DzwqaryCReNAACSfd_oYYPpX0_tw-

76310 次浏览

I have had a similar problem. What I find is that I need to open up the Chrome developer tools and then hit Ctrl + F5. Only then is the cache refreshed.

Update

Also, I would recommend that you select "Disable Cache" in the developers tools ("Network" tab).

Also if you right click the reload button there is a Empty Cache and Hard Relaod option

This doesn't work unless you have dev tools open. So you need to first inspect the element, then right click on the refresh button. Then you have the options of Empty Cache and Hard Reload

You can also try clearing the cookie data for the relative site in development under Application's: storage/cookies option.

The last time F5 and Ctrl-F5 didn't work for me was when I hit the F-lock key (Microsoft keyboard) It is like Num-Lock but for the function key.

The only thing that worked for me was logging out of my google account. For some reason, being logged in to an account shared between various devices wasn't allowing the cache to purge properly. I tried clearing the browser cache manually, Using a 3rd party cache cleaner, flushing the DNS cache, checking the checkbox in dev tools to ignore cache, using an incognito window. Nothing worked! As soon as I logged out everything purged from the test device properly.

It seems that CTRL+F5 is for Internet Explorer, and Shift+F5 is for Chrome.

EDIT (Feb 21, 2019): With the more recent Chromes, I've switched to CTRL-Shift-R as this seems to be the official - and more reliable - behaviour.

Another answerer pointed out that right-clicking the reload button gave the option, but this no longer seems to be the case (Version 72.0.3626.109).

I tried everything, even uninstalling Chrome itself. No luck. It turned out that it's caching using your Google account. I "solved" the issue by appending a random string to my .js filename.

<script type="text/javascript" src="js/bundle.js?r=37173634873"></script>

where the number is always different. You can use PHP or the bundler itself

This forces the browser to load the "new" js file

In Mac is as simple of shift + cmd + R. I can imaging in windows is similar as shift + control + R

Life is easy do not complicate.

It depends on account, need to log out or use chromium for better testing, this piece of code give exact information about held memory:

async getCacheStoragesAssetTotalSize() {
const cacheNames = await caches.keys();


let total = 0;


const sizePromises = cacheNames.map(async cacheName => {
const cache = await caches.open(cacheName);
const keys = await cache.keys();
let cacheSize = 0;


await Promise.all(keys.map(async key => {
const response = await cache.match(key);
const blob = await response.blob();
total += blob.size;
cacheSize += blob.size;
}));


console.log(`Cache ${cacheName}: ${cacheSize} bytes`);
});


await Promise.all(sizePromises);


return `Total Cache Storage: ${total / 1e6} MB`;
}

If other advices like Ctrl + F5 and diabling cache still don't work for you, check if Chrome Data Saver is installed and switched on and disable it if it is.

Link to the Chrome Data Saver ext https://chrome.google.com/webstore/detail/data-saver/pfmgfdlgomnbgkofeojodiodmgpgmkac?hl=en (you can see if it is installed at the page and how to switch it off).

For testing and developing purpose only, you can make a use of the .htaccess file inside your developing root server, it will help you control the caching policy of the browser so you will able to work in non-caching environment.

From Wikipedia (.htaccess):

.htaccess files allow a server to control caching by web browsers and proxies to speed up websites

The mod_expires tell the browser that the file is expire so it will go and fetch it again after 1 minute (you can even set it for 0 seconds - the file immediately expires)

<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 minutes"
ExpiresByType text/javascript "access plus 1 minutes"
ExpiresByType text/html "access plus 1 minutes"
ExpiresByType text/css "access plus 1 minutes"
ExpiresByType image/gif "access plus 1 minutes"
ExpiresByType image/png "access plus 1 minutes"
ExpiresByType image/jpeg "access plus 1 minutes"
</IfModule>

see additional answer

This may be the result of using an Application Cache. If you have a cache.manifest included in your page via the html tag: <html manifest="cache.manifest">, then you have to edit it for the files listed therein to be re-freshed (e.g. consider adding or modifying a comment like #v1.0).

Also ensure the file you want to update is listed in the cache manifest.

So I also did everything. Cleared the cache, signed out of Chrome. Tried to upload the files using only the FTP etc. etc. etc. Until I realised the reason is server-side caching. I just had to sign into my cPanel and switch Cachewall off.

In my case, none of the described solutions worked. I have Google Chrome version 71.0.3578.98 64 bit. However, playing around with Chrome controls I found this solution:

  1. Click on the 3 vertical dots on the top right corner of the browser
  2. Click on "More tools"
  3. Click on "Clear Browsing data..."
  4. Under the almost invisible "Basic" tab, change "Time range" to "All time"
  5. Uncheck "Browsing history", unless you want to clear this data too
  6. Uncheck "Cookies and other site data", this one is highly recommended, you probably don't want to lose your login names and passwords for all sites.
  7. Check "Cached images and files", this is what we want to clear
  8. Click the blue button "Clear data"

That's all.

I've had this problem countless times while developing software. Even completely clearing the Chrome cache doesn't always work.

The solution for me was to install the Chrome extra: Classic Cache Killer. You click on it in the toolbar, the icon turns green, and as far as I can tell, Chrome caches nothing. It automatically turns itself off when you move to another web site. It has a 5 star rating with over 28,000 reviews.

Once you've loaded a page with Cache Killer on, the old cache files relevant to that page are gone.

Hit control + shift + R for Chrome 75.0.3770.100 (Official Build) (64-bit) this is also the Mac key combination control + shift + F5 doesn't work for me

Open Chrome Developer Tools By pressing F12 Then Application > LocalStorage and Click the right mouse button and clear. Simply you need to clear the localstorage. You can also do the same thing by using any chrome extension

enter image description here