htmlmeta-tags

meta in HTML run a hard refresh


I created an HTML file to obtain a file that will update data every minute.

I had tried <meta http-equiv="refresh" content="60"> function but it doesn't show the latest data.

If I press CTRL + F5 manually, the page will update the latest data.

How do I perform a hard refresh instead of normal refresh in HTML by using <meta http-equiv="refresh" content="60">?


Solution

  • Update

    I found the issue, is it because my source file(xml file) is getting the same data.

    After I change the xmlhttp.open("GET", "merged_.xml, true); to

    xmlhttp.open("GET", "merged_.xml?id="+Math.random(), true);

    The source file will update to the latest data.

    Reference: https://www.webmasterworld.com/javascript/4283873.htm