Browsers won't reflect changes made in html file
Solution 1
You can try out the following
- Clear the cache of the browser.
- Do a clean build of the Webapp
OR
Open the Browser in InCognito or Private Browsing Mode
OR
Try to put a meta tag in your HTML
<meta http-equiv="pragma" content="no-cache" />
Solution 2
The problem might be due to your Browser caching the HTML Page. This problem may be avoided by -
Clearing the Cache of your Browser
Try using a false query such as mypage.html?random=6 This method cause the browser to reload he page entirely on a GET request.
-
Use meta tags as below
<meta http-equiv="pragma" content="no-cache" />
This sometimes is accompanied by another meta in addition as follows
<meta http-equiv="expires" content="-1" />
It has been observed that sometimes both the above tags are ignored in IE. The suggested workaround is to use the tag twice, i.e. at start as well end of page. This is due to reason because first a 64K buffer is filled by browser on page load. if the buffer is not filled, the "pragma" is simply ignored. Placing this at end of document facilitates no-caching.
Solution 3
If you are using Firefox install the extension called web developer.
Then go to Disable -> Disable Cache -> Disable entire cache.
If you are using Chrome or Chrommium open developer firebug (f12) then go settings (bottom, right) and enable checkbox with text "Disable cache".
In both cases remember to recharge the web page with control+shift+R (various times :P).
And remember to disable this options when you've end your work.
Solution 4
Another trick is to add a false query behind your html tag and force the browser to fetch a new page.
For example:
MySite.html -> MySite.html?q=1, MySite.html?q=2, MySite.html?q=3, and so forth.
As others have mentioned, it seems to be caching is enabled on your host provider.
malutan.mircea
Updated on July 09, 2022Comments
-
malutan.mircea almost 2 years
I am developing a web site and just ran into a very disturbing problem. My code won't refresh in any browser, meaning not just Internet Explorer but also Google Chrome and Firefox.
The thing is, in a previous version of the HTML file, I have had a div with a link in it (
<a href="">Send request</a>
). Today, I have changed that link into a paragraph (<p>Send request<p>
).When I load my page, it still displays the link. When I commented out the paragraph and reloaded the page, there was no link and my paragraph was checked out. I checked the source file in Chrome and yes, the source file is correct. However, the browser still displays a link that doesn't exist, and deleting the browser history didn't help.
Any ideas?
-
Lowkase about 11 yearsSounds like a caching issue up on the server.
-
bobber205 about 11 yearsTry turning off caching in Chrome.
-
Sebas about 11 yearswhat happends if you clear your browser's cache? what you could do is to suffix all your resources by
?time=<?php echo microtime(true); ?>
example:<script src="./myscript.js?time=<?php echo microtime(true); ?>"/>
-
xpy about 11 yearsInstead of viewing the source code, why don't you just inspect the element with the inspector? ( on chrome, right click -> inspect element ) if you see it, it should be there. And the code you see in the 'source code' is the code that came from the server before any javascript execution
-
user1428716 about 11 yearspossible to put your html on jsfiddle ?
-
user1428716 about 11 years@xpy - he is not reading the file from Server - its a local HTML File
-
xpy about 11 years@user1428716 You're right, but either way it's the same for the browser.
-
malutan.mircea about 11 yearsI've tried inspecting the element and it contains the old link... So inspecting the element reveals the former version of the html while the source shows the current one
-
xpy about 11 years@malutan.mircea Actually the inspector shows the produced HTML, that means that the element you see is propably added via Javascript, try disabling Javascript temporarily (or comment it out) to see what happens...
-
-
user1428716 about 11 yearswhat does the HTTP Status code for the request say ? HTTP 200 or HTTP 304 ?- Chrome Dev tool -> Network Requests . If its not showing in Incognito something might be problem with the code itself. Any JS Error ?
-
malutan.mircea about 11 yearsThanks...I installed the plugin and refreshed the page about 20 times using ctrl+shift+r but it still doesn't reflect the latest changes made to the html file...
-
José Cabo about 11 yearsHave you enabled (disable cache option) what I said in solution?
-
user1428716 about 11 yearswhich IDE you are using ? .. if Eclipse -> Server Tab -> Right Click -> Clean ( It will discard all published state)
-
malutan.mircea about 11 yearsJust to be clear i'm writing the website in notepad++. it has not been deployed yet, it is still in the creation process...it's not anythig big. just a simple website with simple functions and some javascript effects..
-
José Cabo about 11 yearsSo the problem is a middleware between browser and server. maybe a cache server inside the server itself or a proxy. Which server are you using?
-
user1428716 about 11 years@JoséCabo - He is writing the website in notepad++. :)
-
user1428716 about 11 years@malutan.mircea thats not a problem if you fetch HTML from local file
-
José Cabo about 11 yearsDo you access to your index.html by file://?? If it is true there is no middleware or something caching your code. You haven't disable cache. Did you restart your browsers?