From 47cc81dbc696b319ddc3511edc4c4271d80a9657 Mon Sep 17 00:00:00 2001 From: rangoDJ <18576423+rangoDJ@users.noreply.github.com> Date: Sat, 10 Oct 2026 18:35:25 -0400 Subject: [PATCH] Revalidate the frontend files on every load nginx served the dashboard and stream page files without Cache-Control, so browsers cached them by guesswork and Cloudflare for 4 hours: after an update the old JavaScript kept running against the new server (the old dashboard polled /api/logs/session, which no longer exists). "expires epoch" sends Cache-Control: no-cache, so unchanged files cost a 304 and updates take effect on the next load. Fixes #69 Co-Authored-By: Claude Opus 5.5 --- root/defaults/default.conf | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/root/defaults/default.conf b/root/defaults/default.conf index bb37818..fc3d971 100644 --- a/root/defaults/default.conf +++ b/root/defaults/default.conf @@ -37,16 +37,24 @@ server { return 302 /login.html; } + # The frontend files carry no version in their URLs, so they are revalidated on every + # load ("expires epoch" sends Cache-Control: no-cache): unchanged files cost a 304, and + # an update takes effect at once. Without it browsers cached them by guesswork and + # Cloudflare for 4 hours, running the old JavaScript against the new server. + # ("expires" is not add_header, so the security headers above still apply.) location = /login.html { root /app/frontend; + expires epoch; } location /css/ { root /app/frontend; + expires epoch; } location /js/ { root /app/frontend; + expires epoch; } location / { @@ -55,6 +63,7 @@ server { root /app/frontend; index index.html; try_files $uri /index.html; + expires epoch; } location /api/ { @@ -84,6 +93,8 @@ server { auth_request /_auth_verify; error_page 401 = @login; alias /usr/share/selkies/web/; + # The Selkies client, patched by ConnectHub: same reason as the frontend above + expires epoch; index index.html; try_files $uri $uri/ =404; }