diff --git a/src/web/server.py b/src/web/server.py index 889efc4..5d8d4e9 100644 --- a/src/web/server.py +++ b/src/web/server.py @@ -49,6 +49,10 @@ from ..midi.handler import MIDIHandler logger = logging.getLogger(__name__) +# ── Cache buster version (bumped on deploy) ───────────────────────── +# Increment this when template/static changes need to bypass browser cache +TEMPLATE_VERSION = "7" + # ── Defaults ───────────────────────────────────────────────────────────────── DEFAULT_HOST = "0.0.0.0" @@ -312,6 +316,8 @@ class WebServer: def _build_app(self) -> FastAPI: templates = Jinja2Templates(directory=str(TEMPLATES_DIR)) + # Inject version into all templates (cache buster for CSS/JS) + templates.env.globals["version"] = TEMPLATE_VERSION @asynccontextmanager async def lifespan(app: FastAPI): diff --git a/src/web/templates/base.html b/src/web/templates/base.html index 0a27419..8910856 100644 --- a/src/web/templates/base.html +++ b/src/web/templates/base.html @@ -6,7 +6,7 @@ {% block title %}Pi Multi-FX Pedal{% endblock %} - + @@ -30,8 +30,8 @@ {% block content %}{% endblock %} - - + + {% block scripts %}{% endblock %} - \ No newline at end of file +