diff --git a/index.html b/index.html
deleted file mode 100644
index 8b91e4d..0000000
--- a/index.html
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-
-Baustelle
-
-
-
-
-
-
-
-
-
-
-
-
- Baustelle
-
- 🟢
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..6b93b7b
--- /dev/null
+++ b/index.php
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+
+
+
+
+Baustelle
+
+
+
+
+
+
+
+
+
+
+
+
+ Baustelle
+
+ 🟢
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/manifest.webmanifest b/manifest.webmanifest
index 2a01053..e2c4621 100644
--- a/manifest.webmanifest
+++ b/manifest.webmanifest
@@ -3,7 +3,7 @@
"short_name": "Baustelle",
"description": "Mobile Doku für Baustellen — Fotos, Sprachnotizen, Skizzen",
"id": "/custom/baustelle/",
- "start_url": "/custom/baustelle/",
+ "start_url": "/custom/baustelle/index.php",
"scope": "/custom/baustelle/",
"display": "standalone",
"orientation": "portrait",
diff --git a/sw.js b/sw.js
index 8a7f97e..0e1a421 100644
--- a/sw.js
+++ b/sw.js
@@ -1,25 +1,23 @@
-/* Baustelle PWA Service Worker — v9
- * Pattern nach claude-db #31:
+/* Baustelle PWA Service Worker
+ * Pattern nach claude-db #201 (filemtime-basiert):
+ * - Cache-Version kommt aus URL-Query ?v=, kein manuelles Hochzählen
* - Network-First für eigene Assets (immer aktuell, Fallback Cache)
* - skipWaiting() + clients.claim() damit Updates sofort greifen
* - Web Share Target via POST → share.html
*/
-const CACHE = 'baustelle-v10';
+// Cache-Version dynamisch aus ?v= — wird von index.php gesetzt
+const SW_VERSION = (new URL(self.location.href)).searchParams.get('v') || 'static';
+const CACHE = 'baustelle-' + SW_VERSION;
const SHELL = [
'./',
- './index.html',
+ './index.php',
'./share.html',
- './app.css',
- './app.js',
- './manifest.webmanifest',
- './lib/idb.js',
- './lib/api.js',
- './lib/offline.js',
- './lib/router.js',
'./icons/icon-192.png',
'./icons/icon-512.png',
'./icons/icon.svg',
+ // CSS/JS werden mit ?v= geladen und dynamisch gecached
+ // beim ersten fetch — nicht in SHELL damit Pre-Cache nicht mit alten v's läuft
];
self.addEventListener('install', (e) => {
@@ -34,7 +32,8 @@ self.addEventListener('activate', (e) => {
e.waitUntil(
caches.keys()
.then(keys => Promise.all(
- keys.filter(k => k !== CACHE).map(k => caches.delete(k))
+ keys.filter(k => k.startsWith('baustelle-') && k !== CACHE)
+ .map(k => caches.delete(k))
))
.then(() => self.clients.claim())
);