How to Force an Automatic Refresh on Single Page App
Hi all,
Thanks in advance for taking a look at this.
I am trying to create a force refresh at one point in my Single Page App.
My general problem is that when I update the page on the server - the changes do not appear because the cache needs to be refreshed. So I am trying to refresh automatically somehow.
So, I have a link on the page that has an onclick="javascript:main()" which triggers a function that sets some vars and then goes to a section of the Page like this:
Part of the functions is:
---
// set vars etc......
// make time stamp for query strings force auto update
var tm = new Date().getTime();
window.location.replace("#main1?tm=" + tm);
---
example result:
https://mysite.com/test.html#main1?tm=1555539113122
Basic question: does the tm(timestamp always different) force a refresh? like...
https://mysite.com/test.html?tm=1555539113122
I am not sure it is really working. maybe because the xxx.html#main comes before the ?tm=xxx?
My question is this the correct way to force an automatic refresh to happen or is there a better way?
