Skip to content

Commit 6832c7d

Browse files
committed
Update queue-page.html
1 parent 86622d4 commit 6832c7d

File tree

1 file changed

+38
-21
lines changed

1 file changed

+38
-21
lines changed

queue-page.html

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>Queue - Please Wait</title>
77

8-
<!-- Multiple refresh mechanisms -->
9-
<meta http-equiv="refresh" content="[[.RefreshInterval]]">
8+
<!-- Primary refresh mechanism -->
9+
<meta http-equiv="refresh" content="[[.RefreshInterval]];url=./">
10+
11+
<!-- Strong cache control -->
1012
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate, max-age=0">
1113
<meta http-equiv="Pragma" content="no-cache">
1214
<meta http-equiv="Expires" content="0">
@@ -96,28 +98,43 @@ <h3>Estimated wait time</h3>
9698
</div>
9799
</div>
98100

99-
<!-- JavaScript that ensures page refresh -->
101+
<!-- Improved multi-layered JavaScript refresh mechanism -->
100102
<script>
101-
// Countdown timer
102-
let countdown = [[.RefreshInterval]];
103-
const countdownElement = document.getElementById('countdown');
104-
105-
function updateCountdown() {
106-
countdown--;
107-
if (countdown <= 0) {
108-
window.location.reload();
109-
} else {
103+
document.addEventListener('DOMContentLoaded', function() {
104+
// Countdown timer
105+
let countdown = [[.RefreshInterval]];
106+
const countdownElement = document.getElementById('countdown');
107+
108+
function updateCountdown() {
109+
countdown--;
110+
if (countdown <= 0) {
111+
// Clean refresh to base path
112+
window.location.href = window.location.pathname;
113+
return;
114+
}
110115
countdownElement.innerText = `This page will automatically refresh in ${countdown} seconds.`;
111116
}
112-
}
113-
114-
// Update countdown every second
115-
setInterval(updateCountdown, 1000);
116-
117-
// Force refresh as a backup
118-
setTimeout(function() {
119-
window.location.reload();
120-
}, [[.RefreshInterval]] * 1000);
117+
118+
// Update countdown every second
119+
const timer = setInterval(updateCountdown, 1000);
120+
121+
// Three-layer refresh mechanism
122+
123+
// Method 1: Basic reload with cache bypass
124+
setTimeout(function() {
125+
window.location.reload(true);
126+
}, [[.RefreshInterval]] * 900); // 90% of refresh interval
127+
128+
// Method 2: Full location replace with clean URL
129+
setTimeout(function() {
130+
window.location.replace(window.location.pathname);
131+
}, [[.RefreshInterval]] * 950); // 95% of refresh interval
132+
133+
// Method 3: Direct assignment to clean location
134+
setTimeout(function() {
135+
window.location = window.location.pathname;
136+
}, [[.RefreshInterval]] * 1000); // 100% of refresh interval
137+
});
121138
</script>
122139
</body>
123140
</html>

0 commit comments

Comments
 (0)