5
5
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6
6
< title > Queue - Please Wait</ title >
7
7
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 -->
10
12
< meta http-equiv ="Cache-Control " content ="no-store, no-cache, must-revalidate, max-age=0 ">
11
13
< meta http-equiv ="Pragma " content ="no-cache ">
12
14
< meta http-equiv ="Expires " content ="0 ">
@@ -96,28 +98,43 @@ <h3>Estimated wait time</h3>
96
98
</ div >
97
99
</ div >
98
100
99
- <!-- JavaScript that ensures page refresh -->
101
+ <!-- Improved multi-layered JavaScript refresh mechanism -->
100
102
< 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
+ }
110
115
countdownElement . innerText = `This page will automatically refresh in ${ countdown } seconds.` ;
111
116
}
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
+ } ) ;
121
138
</ script >
122
139
</ body >
123
140
</ html >
0 commit comments