Fix: Tiles-Cache-Bust — versionierte PMTiles-URL + version-bewusstes Caching

'nur DACH auf Staging' Ursache: serve_tile schickte Cache-Control max-age=86400
OHNE Validator → Browser lieferte bis 24h die ALTEN PMTiles-Bytes (altes Directory)
trotz Datei-Swap. Fix:
- map-gl-style.js: tilesUrl() hängt ?v=TILES_VER an (Cache-Bust bei Tile-Deploy)
- serve_tile: ?v vorhanden → max-age=1y immutable; ohne → max-age=60 (self-heal) + ETag
- Makefile tiles-deploy zählt TILES_VER automatisch hoch + erinnert an Frontend-Deploy
This commit is contained in:
rene 2026-06-05 19:18:43 +02:00
parent 80b56c32ab
commit 2a809a9a0b
8 changed files with 33 additions and 18 deletions

View file

@ -3,7 +3,7 @@
Router, State-Management, Navigation, Initialisierung.
============================================================ */
const APP_VER = '1207'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VER = '1208'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt
window.APP_VER = APP_VER; // global verfügbar für andere Module (z.B. offline-indicator)
window.APP_VERSION = APP_VERSION;

View file

@ -6,7 +6,11 @@
'use strict';
var TILES_FILE = 'dach.pmtiles';
function tilesUrl() { return window.location.origin + '/tiles/' + TILES_FILE; }
// Cache-Bust: gleiche Datei-URL, aber Inhalt ändert sich bei jedem Tile-Deploy (atomarer Swap).
// Ohne Versions-Param liefert der Browser bis zu 24h die ALTEN PMTiles-Bytes (inkl. altem Directory)
// → man sähe die alte Abdeckung. Bei jedem `make tiles-deploy` HOCHZÄHLEN (Makefile sed't das).
var TILES_VER = '20260605';
function tilesUrl() { return window.location.origin + '/tiles/' + TILES_FILE + '?v=' + TILES_VER; }
var THEMES = {
light: {