I realize this question has been asked before. I have read the previous questions, and the solutions are not working for me. Chrome absolutely refuses to clear all cached data. This is interfering with my ability to test a website I am developing.
Issue: No matter how I attempt to clear cached data for my website, Chrome still serves cached versions of some parts of index.html. It almost always occurs with CSS embedded in a
<style> tag in the head of my index.html file. I will make a change to this CSS, restart the Python code that serves index.html "Empty Cache and Hard Reload" the page and Chrome will use the exact same CSS as before, without my changes.
I have tried the following:
- Going into Chrome settings and clearing all data from the beginning of time.
- Restarting the browser.
- Checking the "Disable Cache" option in the network tab of the dev tools (and refreshing)
- "Empty Cache and Hard Reload"
- Sending the header
Cache-Control: no-store, no-cache, must-revalidate, max-age=0
- All possible combinations of these steps.
I wrote the server code myself. It's very simple and absolutely not serving the same thing over and over again. I restarted it every time I tried to clear the cache just to be sure.
What is even stranger in my opinion, is that changes made to the actual html in index.html are reflected in the browser. It's like Chrome is choosing to cache the contents of the
<style> tag but behaving with everything else.
I have a very annoying solution to this problem. If I increment the port number that the server is running on every time I make a change, Chrome will not use any kind of cache on the first load. I'd rather not have to do this.
This is probably irrelevant, but both the server and the browser are on the same Windows 10 computer.