diff --git a/nginx.conf b/nginx.conf index 2c3229d..08a7ce9 100644 --- a/nginx.conf +++ b/nginx.conf @@ -9,6 +9,13 @@ server { 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 gzip on; gzip_types text/html text/css application/javascript; diff --git a/src/game/Game.js b/src/game/Game.js index 76aef4c..0c96122 100644 --- a/src/game/Game.js +++ b/src/game/Game.js @@ -509,7 +509,11 @@ export class Game { } 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 => { if (response.ok) { return response.json();