Skip to content

Revalidate the frontend files on every load - #70

Merged
rangoDJ merged 1 commit into
mainfrom
fix/revalidate-frontend-files
Oct 10, 2026
Merged

rangoDJ merged 1 commit into
mainfrom
fix/revalidate-frontend-files

Conversation

@rangoDJ

@rangoDJ rangoDJ commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Fixes #69

What changed

default.conf: expires epoch; (→ Cache-Control: no-cache, Expires in the past) on /login.html, /css/, /js/, / (the dashboard) and /stream/ (the patched Selkies client). Browsers and Cloudflare then revalidate these files on every load: unchanged ones come back as 304 (nginx sends Last-Modified/ETag), and a new image takes effect on the next page load. expires isn't add_header, so the server-level security headers still apply in these locations.

Why

Seen on the live install behind a Cloudflare tunnel right after deploying #66: Cloudflare served /js/app.js and /css/style.css from cache (cf-cache-status: HIT, max-age=14400, previous image's last-modified), so the old dashboard kept polling the removed /api/logs/session (404) and the new Logs window didn't appear.

Testing

  • nginx config validity and the headers: being checked in a throwaway container from a manual build of this branch (results in a comment).

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@rangoDJ

rangoDJ commented Oct 10, 2026

Copy link
Copy Markdown
Owner Author

Tested in a throwaway container from sha-47cc81d (no ports, volumes or GPU):

  • nginx accepted the config and is running (/run/nginx.pid present, no errors on stderr); Xvfb, uvicorn and Selkies started normally.
  • The served /etc/nginx/sites-available/default is the image's own file and has expires epoch; in /login.html, /css/, /js/, / and /stream/, so it also applies to existing installs (nothing is copied into /config).
  • The response headers can't be read from inside the container through Dockhand, so I'll check for Cache-Control: no-cache on the live site after the redeploy.

Container removed after the test.

🤖 Generated with Claude Code

@rangoDJ
rangoDJ merged commit 7328bf9 into main Oct 10, 2026
8 checks passed
@rangoDJ
rangoDJ deleted the fix/revalidate-frontend-files branch October 10, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard and stream page run stale JavaScript for hours after an update

1 participant