commit aabd5cd68a20bbd86d33254f4ddcb835b26ca3d9
parent b27a5588d8aaf7123d4ffe4ee31331149c46066e
Author: Julian Piribauer <julian.piribauer@gmail.com>
Date: Sun, 3 May 2026 12:10:47 +0000
Add no-cache to HTML response; add onerror banner to surface JS errors
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat:
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/main.py b/app/main.py
@@ -120,7 +120,9 @@ def _parentlink_dict(pl: ParentLink) -> dict:
@app.get("/", include_in_schema=False)
async def root():
- return FileResponse(os.path.join(STATIC_DIR, "index.html"))
+ r = FileResponse(os.path.join(STATIC_DIR, "index.html"))
+ r.headers["Cache-Control"] = "no-cache"
+ return r
@app.get("/api/me")
diff --git a/static/index.html b/static/index.html
@@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <script>window.onerror=function(m,s,l,c,e){var b=document.createElement('div');b.style.cssText='position:fixed;top:0;left:0;right:0;background:#bf616a;color:#fff;padding:1rem;z-index:99999;font-family:monospace;font-size:13px;white-space:pre-wrap';b.textContent='JS ERROR: '+m+'\n'+s+':'+l;document.body?document.body.prepend(b):document.addEventListener('DOMContentLoaded',function(){document.body.prepend(b)});};</script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=EB+Garamond:ital,wght@0,400;0,600;1,400&display=swap" rel="stylesheet">