Feature/Gameloop enhancements #17
2 changed files with 12 additions and 1 deletions
|
|
@ -9,6 +9,13 @@ server {
|
||||||
try_files $uri $uri/ =404;
|
try_files $uri $uri/ =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Prevent caching of version.json
|
||||||
|
location = /version.json {
|
||||||
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||||
|
add_header Pragma "no-cache";
|
||||||
|
add_header Expires "0";
|
||||||
|
}
|
||||||
|
|
||||||
# Enable gzip compression
|
# Enable gzip compression
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_types text/html text/css application/javascript;
|
gzip_types text/html text/css application/javascript;
|
||||||
|
|
|
||||||
|
|
@ -509,7 +509,11 @@ export class Game {
|
||||||
}
|
}
|
||||||
|
|
||||||
loadVersion() {
|
loadVersion() {
|
||||||
fetch('/version.json')
|
// Add cache-busting query parameter to ensure fresh version data
|
||||||
|
const cacheBuster = `?t=${Date.now()}`;
|
||||||
|
fetch(`/version.json${cacheBuster}`, {
|
||||||
|
cache: 'no-store'
|
||||||
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
return response.json();
|
return response.json();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue