Fix: iOS SW-Update — SKIP_WAITING Handler, location.replace() statt reload(), no-store Header (SW by-v762)

This commit is contained in:
rene 2026-05-07 19:22:22 +02:00
parent a8b4fd781f
commit a3c8d77a14
4 changed files with 20 additions and 14 deletions

View file

@ -327,7 +327,7 @@ MEDIA_DIR = os.getenv("MEDIA_DIR", "/data/media")
os.makedirs(MEDIA_DIR, exist_ok=True)
app.mount("/media", StaticFiles(directory=MEDIA_DIR), name="media")
APP_VER = "761" # muss mit APP_VER in app.js übereinstimmen
APP_VER = "762" # muss mit APP_VER in app.js übereinstimmen
@app.get("/api/version")
async def app_version():
@ -848,7 +848,7 @@ async def share_target(request: Request):
# Weiterleitung zur App mit den Daten
return FileResponse(
f"{STATIC_DIR}/index.html",
headers={"Cache-Control": "no-cache"}
headers={"Cache-Control": "no-store, no-cache"}
)
# Öffentliche Hunde-Profilseite (für NFC-Tags, kein Login nötig)
@ -1182,17 +1182,17 @@ async def public_dog_page(dog_id: int):
# ------------------------------------------------------------------
@app.get("/teilen/{token}")
async def invite_page(token: str):
return FileResponse(f"{STATIC_DIR}/index.html", headers={"Cache-Control": "no-cache"})
return FileResponse(f"{STATIC_DIR}/index.html", headers={"Cache-Control": "no-store, no-cache"})
@app.get("/breeder/{zwingername}")
async def breeder_profile_page(zwingername: str):
return FileResponse(f"{STATIC_DIR}/index.html", headers={"Cache-Control": "no-cache"})
return FileResponse(f"{STATIC_DIR}/index.html", headers={"Cache-Control": "no-store, no-cache"})
@app.get("/litters")
async def litters_page():
return FileResponse(f"{STATIC_DIR}/index.html", headers={"Cache-Control": "no-cache"})
return FileResponse(f"{STATIC_DIR}/index.html", headers={"Cache-Control": "no-store, no-cache"})
# ------------------------------------------------------------------
@ -1200,7 +1200,7 @@ async def litters_page():
# ------------------------------------------------------------------
@app.get("/widget")
async def widget_page():
return FileResponse(f"{STATIC_DIR}/index.html", headers={"Cache-Control": "no-cache"})
return FileResponse(f"{STATIC_DIR}/index.html", headers={"Cache-Control": "no-store, no-cache"})
# ------------------------------------------------------------------
@ -1726,7 +1726,7 @@ async def partner_landing():
</div>
</body>
</html>"""
return HTMLResponse(content=html, headers={"Cache-Control": "no-cache"})
return HTMLResponse(content=html, headers={"Cache-Control": "no-store, no-cache"})
# ------------------------------------------------------------------
@ -1924,8 +1924,8 @@ async def spa_fallback(full_path: str):
'<link rel="apple-touch-icon" sizes="180x180" href="/icons/icon-180.png">',
'<link rel="apple-touch-icon" sizes="180x180" href="/icons/icon-180-staging.png">',
)
return HTMLResponse(content=html, headers={"Cache-Control": "no-cache"})
return HTMLResponse(content=html, headers={"Cache-Control": "no-store, no-cache"})
return FileResponse(
f"{STATIC_DIR}/index.html",
headers={"Cache-Control": "no-cache"}
headers={"Cache-Control": "no-store, no-cache"}
)