I test an html/js code on my localhost (Windows 7, Chrome v79.0.3945.130 (64-bit)) and about 50% of the time code changes are not reflected in the browser (I see it with Dev Tools/Sources).
There are a ton of advice on the internet, but neither seems to work:
- Rightclick on the reload and chose "Empty cache and Hard reload" - doesn't help in 30% of the cases.
- Disable cache in the Network tab of the Chrome Dev Tools - doesn't help.
- Add
<meta http-equiv="Cache-control" content="no-cache">
in the header - doesn't help. - Replace
<script src="common.js"></script>
by<script src="common.js?blabla"></script>
- helps in 60% of the cases, but you need to do it after every change is a huge chore. Also, it doesn't work with html changes. - Copy a file to a new file (like index.html to index2.html) and replace the file name in the code - always works, but it is an even bigger chore.
The exact same problem present when I commit the code to github.io
Please help me to make it so the site reflects the code changes immediately.
Edit: I've created a file index3.html and put only "hello world" there. Opened the file in the browser. Changed to "hello world2" - the browser updated the content. Changed to "hello world3" - the browser still was showing "hello world2" even after multiple reloads and "Empty cache and hard reload". I changed to "hello world4" - the browser still showed "hello world2". In for 4 hours I changed to "hello world5" - the browser still shows "hello world2". This file I edited with basic notepad.
Edit2: People keep asking what server I'm using. This looks like a part of the problem. Unfortunately, I don't know and neither do i know what exactly I need to do to check it. Here is all I've found out so far:
- I have
inetpub/wwwroot
directory where I put html & js files and then open index.html in a browser athttp://localhost/
. - My Network panel in Devs Tools looks like this: image link.
- The server setup was very fast and didn't require any additional software to install. I.e. I'm not using node.js.
- There is iisstart.htm at
inetpub/wwwroot
and when I openhttp://localhost/iisstart.htm
it says IIS7.