Weltkueche-Admin: Cache-Busting der Daten-Fetches (?v=ts + no-store)
Verhindert, dass die QA-Uebersicht eine gecachte production-matrix.json/dishes.json zeigt. Loest "Admin zeigt noch alten Stand nach Deploy". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -197,10 +197,11 @@ fetch(BASE + '/api/admin', {method:'POST', headers:{'Content-Type':'application/
|
|||||||
.then(function(r){return r.json();})
|
.then(function(r){return r.json();})
|
||||||
.then(function(r){
|
.then(function(r){
|
||||||
if (!r.authenticated){ location.href = 'admin.html'; return; }
|
if (!r.authenticated){ location.href = 'admin.html'; return; }
|
||||||
|
var _bust = '?v=' + Date.now(); // Cache-Busting: Admin-QA zeigt IMMER die frischen Daten, nie eine gecachte JSON
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
fetch(D+'countries-full.json').then(function(r){return r.json();}),
|
fetch(D+'countries-full.json'+_bust, {cache:'no-store'}).then(function(r){return r.json();}),
|
||||||
fetch(D+'production-matrix.json').then(function(r){return r.json();}),
|
fetch(D+'production-matrix.json'+_bust, {cache:'no-store'}).then(function(r){return r.json();}),
|
||||||
fetch(D+'dishes.json').then(function(r){return r.json();}),
|
fetch(D+'dishes.json'+_bust, {cache:'no-store'}).then(function(r){return r.json();}),
|
||||||
]).then(function(a){
|
]).then(function(a){
|
||||||
C = a[0]; PM = a[1];
|
C = a[0]; PM = a[1];
|
||||||
DISHES = Object.keys(a[2]).filter(function(k){return k[0]!=='_';}).map(function(id){ return Object.assign({id:id}, a[2][id]); });
|
DISHES = Object.keys(a[2]).filter(function(k){return k[0]!=='_';}).map(function(id){ return Object.assign({id:id}, a[2][id]); });
|
||||||
|
|||||||
Reference in New Issue
Block a user