Weltkueche: Cache-Busting (no-store) fuer die Daten-Fetches im Spiel
Damit das Spiel nach einem Deploy nie eine gecachte dishes/production-matrix zeigt (gleiche Klasse Fix wie im Admin-Tool). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -519,11 +519,12 @@ window.playSfx = playSfx;
|
||||
|
||||
async function loadWeltkuecheData() {
|
||||
const base = (window.WK_BASE || './');
|
||||
const _nc = { cache: 'no-store' }; // frische Daten nach Deploy — kein gecachtes JSON
|
||||
const [dishesJ, countriesFull, prodMatrix, transportJ] = await Promise.all([
|
||||
fetch(base + 'assets/data/dishes.json').then(r => r.json()),
|
||||
fetch(base + 'assets/data/countries-full.json').then(r => r.json()),
|
||||
fetch(base + 'assets/data/production-matrix.json').then(r => r.json()),
|
||||
fetch(base + 'assets/data/transport.json').then(r => r.json()).catch(() => ({})),
|
||||
fetch(base + 'assets/data/dishes.json', _nc).then(r => r.json()),
|
||||
fetch(base + 'assets/data/countries-full.json', _nc).then(r => r.json()),
|
||||
fetch(base + 'assets/data/production-matrix.json', _nc).then(r => r.json()),
|
||||
fetch(base + 'assets/data/transport.json', _nc).then(r => r.json()).catch(() => ({})),
|
||||
]);
|
||||
// Länder-Map komplett aus countries-full ersetzen (überschreibt frühere inline-Defaults)
|
||||
Object.entries(countriesFull).forEach(([k, v]) => { C[k] = v; });
|
||||
|
||||
Reference in New Issue
Block a user