As Joseph mentioned, a get function gets cached for 30 seconds. Based on tip from Wassim; I now add a random number which force refreshes the get.
I made the following function, which probably can be simplified quite a lot π
function refresh() {
let params = (new URL(document.location)).searchParams;
let id = params.get("id");
let d = new Date();
let urlrefresh = window.location.href.split('?')[0] + "?id=" + id + "&uc=" + d.getSeconds() + d.getMilliseconds();
location.replace(urlrefresh);
}
The idea behind this, is that I add a random &uc[number] behind the url.
Thanks Wassim!