From fd7c9475c8f3ff632fc41613c3324f6c49ebaa37 Mon Sep 17 00:00:00 2001 From: Amolith Date: Fri, 17 Oct 2025 18:03:10 -0600 Subject: [PATCH] feat: implement CSS cache-busting for web assets Add version query parameters to CSS URLs to force browsers to fetch newer versions after edits. This ensures users see updated styles without manually clearing browser cache. Changes: - Add ?v=1 to overrides.css and syntax.css URLs - Document version increment process in AGENTS.md Implements: bug-9b0a200 Co-Authored-By: Crush --- AGENTS.md | 6 ++++++ pkg/web/templates/base.html | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 2b872b364a82a0b495d66e4726ea7138f80a043a..eb4e2f3544541aa5586226f90284fd2ebcf6b9d3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -88,6 +88,12 @@ SOFT_SERVE_DISABLE_RACE_CHECKS=1 go test ./... go build -o soft ./cmd/soft ``` +#### CSS Cache-Busting + +When editing CSS files in `pkg/web/static/`, increment the version query parameter in `pkg/web/templates/base.html`: +- `overrides.css?v=1` → `overrides.css?v=2` +- `syntax.css?v=1` → `syntax.css?v=2` + ### Environment Variables All configuration can be set via environment variables with the `SOFT_SERVE_` prefix: diff --git a/pkg/web/templates/base.html b/pkg/web/templates/base.html index ea7da7d5d5816b00a729d38d7ccfd19701ed51f2..51a8f9b6291c4e00b99f1d3496e98e0d00a7cb15 100644 --- a/pkg/web/templates/base.html +++ b/pkg/web/templates/base.html @@ -9,8 +9,8 @@ {{if .Repo}}{{if .Repo.Description}}{{end}}{{end}} - - + +