From 82e1a4e1271905ea1e4e16b78a33f3cc595253f8 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 30 Jun 2026 20:00:26 -0400 Subject: [PATCH] fix(agent): send Cache-Control: no-store so a new image isn't masked by cache The control page is a static string served with no cache headers, so after pulling a fresh agent image the browser kept showing the OLD UI until a hard refresh (operator-flagged). Add a no-store middleware covering the page and the status/gpu/logs polls. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Ttrj5P7upUTueSfoJcxEqa --- agent/fc_agent/app.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/agent/fc_agent/app.py b/agent/fc_agent/app.py index 1b4d0e3..55a9b81 100644 --- a/agent/fc_agent/app.py +++ b/agent/fc_agent/app.py @@ -18,6 +18,17 @@ worker = Worker(cfg) app = FastAPI(title="FabledCurator GPU agent") +@app.middleware("http") +async def _no_store(request, call_next): + # The control page is a static string and the status/gpu/logs polls are + # live data — never let the browser cache either, or a freshly-pulled agent + # image still shows the OLD UI until a hard refresh (operator-flagged + # 2026-06-30). + resp = await call_next(request) + resp.headers["Cache-Control"] = "no-store" + return resp + + @app.on_event("startup") def _maybe_autostart() -> None: # With AUTO_START set, a container restart (host reboot, or `restart: