I have a web url www.mywebpage.com/subpage?id=123 which contains:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<script>
const queryString = window.location.search;
console.log(queryString);
const urlParams = new URLSearchParams(queryString);
const identifier = urlParams.get('id');
window.location.replace("https://anotherwebpage.com/anothersubpage?id=" + identifier);
</script>
</head>
<body>
</body>
</html>
All I am doing is taking the id and redirecting to another page, passing in that parameter. This works correctly, until I load the page with a different identifier. It seems that Chrome is still caching the page (in spite of the meta tags), so it redirects to the other page with the old identifier.
How do I ensure that this script runs on every single load of the page so it always redirects with the provided identifier?