Reputation: 659
I am working on a new site and whenever I change CSS settings chrome will not accept those changes unless I close out of chrome completely with Task manager and relaunch it. I have a tried quite a few things. Below is a list of things I've tried:
--disk-cache-dir=null
Anyone have any ideas how to help? It is extremely annoying and inefficient to close chrome every time I want to check a CSS change. Another annoyance is that I am trying to listen to music in the browser so if I close chrome I have to go back and get my music playing again and it's just as of now extremely annoying and way more time consuming than I want.
I've tried looking at other articles online about cache busting and other articles on Stack Overflow but I've tried to do most of what they suggest and I haven't seen any positive outcome yet. Most articles say to add some sort of random string or version on the end of the CSS file as a GET request but that isn't working though I know that has worked for me in the past.
Upvotes: 20
Views: 37347
Reputation: 2708
My Chrome (on Linux) was getting stuck on 'Clear data' activity.
The solution came from here https://www.winhelponline.com/blog/fix-google-chrome-freezes-on-clear-browsing-data/
Summary:
This worked for me without touching anything on the extensions. However I had to wait for more than 20 minutes, as the user-profile had accumulated more than 600MB of changes (I use psd
to map the profile to RAM and I can see that detail with psd preview
).
Upvotes: 0
Reputation: 316
"clearing cache" is not as easy as it should be. Instead of clearing cache on my browsers, I realized that "touching" the server files cached will actually change the date and time of the source file cached on the server (Tested on Edge, Chrome and Firefox) and most browsers will automatically download the most current fresh copy of whats on your server (code, graphics any multimedia too). I suggest you just copy the most current scripts on the server and "do the touch thing" solution before your program runs, so it will change the date of all your problem files to a most current date and time, then it downloads a fresh copy to your browser:
<?php
touch('/www/sample/file1.css');
touch('/www/sample/file2.css');
touch('/www/sample/file2.css');
?>
then ... the rest of your program...
It took me some time to resolve this issue (as many browsers act differently to different commands, but they all check time of files and compare to your downloaded copy in your browser, if different date and time, will do the refresh), If you can't go the supposed right way, there is always another usable and better solution to it. Best Regards and happy camping. By the way touch(); or alternatives work in many programming languages inclusive in javascript bash sh php and you can include or call them in html.
Upvotes: 1
Reputation: 659
Development server was running various caching tools though they should have been turned off. After disabling them chrome started to work better and most of the time CTRL+F5 did the trick.
Upvotes: 8
Reputation: 763
pres f12 > f1 > network > disable cache (while DevTools is open). This should solve your problem
Upvotes: 17
Reputation: 2133
If you are trying out new CSS updates, I suggest using Chrome's "Inspect" function to dynamically update CSS settings and observe the results interactively. This may save some time during update cycles as compared to manual edits alone.
Another option to try is to define "cache-control" meta tags in your head section. For development/testing, you may want to have no caching. For a real website, you may want to have a shorter age limit. Refer to the following SO Q&A.
Using meta tags to turn of caching in all browsers?
Upvotes: 0
Reputation: 704
I used to have the same problem, and I believe it's a (pretty annoying) bug with chrome. You can use the CSS Reloader Chrome Extension to solve it. Not ideal, but better
Upvotes: 1