问题
I'm working on a web project but I have this really annoying issue with my browser, Google Chrome... Everytime I make changes on my website, my browser won't refresh and clear cache. It works totally fine in my friends 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.
It's quite annoying, so if anyone could help me, I would deeply appreciate it.
Thank you all!
回答1:
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).
回答2:
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
回答3:
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.
回答4:
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:
- Click on the 3 vertical dots on the top right corner of the browser
- Click on "More tools"
- Click on "Clear Browsing data..."
- Under the almost invisible "Basic" tab, change "Time range" to "All time"
- Uncheck "Browsing history", unless you want to clear this data too
- 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.
- Check "Cached images and files", this is what we want to clear
- Click the blue button "Clear data"
That's all.
回答5:
We had this caching problem in one of our windows 8.1 computer. But I'm sure this issue is exist in all new version of windows and chrome.
So this is what we did to clear the google chrome cache and none of this work for us.
- Clear cache using google chrome options.
- Full page reload ( Ctrl + F5 )
- Uninstall google chrome install again.
So the conclusion is google chrome getting cached data from somewhere in your own hard disk. Sorry I didn't know exact location right now. ( Will find it and update ) .
All I did was doing a disk cleanup for the partition which has windows OS installed. To do this please follow bellow steps and its better to restart after doing this.
- Right click on the drive.
- Go to properties.
- Click on disk cleanup button wait till you see the report.
- Check all options in side the dialog window.
- Click on OK button.
- Restart windows.
http://guntucomputerhacks.blogspot.com/2017/08/google-chrome-cache-not-clearing.html
回答6:
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
回答7:
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).
回答8:
You can also try clearing the cookie data for the relative site in development under Application's: storage/cookies option.
回答9:
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.
回答10:
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).
回答11:
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.
回答12:
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.
回答13:
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.
回答14:
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
回答15:
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`;
}
回答16:
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
回答17:
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.
来源:https://stackoverflow.com/questions/25958420/chrome-wont-clear-cache-ctrl-f5-doesnt-seem-to-work-either