From a8deb1fa8bb3a4c6ba1a77c870dc7c2ae47edcd7 Mon Sep 17 00:00:00 2001 From: savsis Date: Thu, 10 Sep 2026 23:34:23 +0500 Subject: [PATCH] fix: no-cache headers on admin panel HTML so updates show up without a hard refresh Co-Authored-By: Claude Sonnet 5 --- api.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api.py b/api.py index 12fa772..f73b654 100644 --- a/api.py +++ b/api.py @@ -814,13 +814,16 @@ def admin_node_status(code: str, request: Request): ADMIN_HTML_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "admin.html") +_NO_CACHE = {"Cache-Control": "no-cache, must-revalidate"} + + @app.get("/") def root(request: Request): if request.headers.get("host", "").split(":")[0] == PANEL_DOMAIN: - return FileResponse(ADMIN_HTML_PATH) + return FileResponse(ADMIN_HTML_PATH, headers=_NO_CACHE) raise HTTPException(404) @app.get("/admin") def admin_page(): - return FileResponse(ADMIN_HTML_PATH) + return FileResponse(ADMIN_HTML_PATH, headers=_NO_CACHE)