From daa3f79a525f135160a4f991c96026bd9b92c8ae Mon Sep 17 00:00:00 2001 From: Giorgio Gilestro Date: Thu, 28 May 2026 19:20:49 +0200 Subject: [PATCH] mobile: cache-bust static assets so browser picks up CSS/JS edits User reported phone still showing old behaviour (Qty/Avg portfolio columns visible) even though the server-side JS had been updated. Root cause: every / - - - - - - - - - - + + + + + + + + + + - - + + +
diff --git a/app/templates/landing.html b/app/templates/landing.html index 8d3d170..0726226 100644 --- a/app/templates/landing.html +++ b/app/templates/landing.html @@ -27,10 +27,10 @@
@@ -48,10 +48,10 @@ off-hours stay quiet.

@@ -66,10 +66,10 @@ in earnings, policy, valuation — not chart patterns.

@@ -87,10 +87,10 @@ not a forecast and not advice on any investment decision.

@@ -100,10 +100,10 @@

More views

-{% if paid %}{% endif %} +{% if paid %}{% endif %} {% endblock %} diff --git a/app/templates/login.html b/app/templates/login.html index 448c883..2cfc899 100644 --- a/app/templates/login.html +++ b/app/templates/login.html @@ -10,9 +10,9 @@ catch (e) { document.documentElement.dataset.theme = 'light'; } })(); - - - + + +
diff --git a/app/templates/public_base.html b/app/templates/public_base.html index 427fc36..b1cef24 100644 --- a/app/templates/public_base.html +++ b/app/templates/public_base.html @@ -14,12 +14,12 @@ } catch (e) { document.documentElement.dataset.theme = 'light'; } })(); - - - - - - + + + + + +
diff --git a/app/templates/settings.html b/app/templates/settings.html index 95edef8..7ce054c 100644 --- a/app/templates/settings.html +++ b/app/templates/settings.html @@ -357,7 +357,7 @@ {% if user %} {# Import widget wiring — auto-parse on drop, preview, then commit. #} - - + + {% endif %} {% endblock %} diff --git a/app/templates/verify.html b/app/templates/verify.html index 43637d4..d28c989 100644 --- a/app/templates/verify.html +++ b/app/templates/verify.html @@ -10,9 +10,9 @@ catch (e) { document.documentElement.dataset.theme = 'light'; } })(); - - - + + +
diff --git a/app/templates_env.py b/app/templates_env.py index 22cfdf6..7240d39 100644 --- a/app/templates_env.py +++ b/app/templates_env.py @@ -3,6 +3,7 @@ Imported by both routers/pages.py and routers/api.py so the filters are registered exactly once.""" from __future__ import annotations +import time from pathlib import Path from fastapi.templating import Jinja2Templates @@ -13,6 +14,13 @@ from app.config import get_settings from app.services.glossary import wrap_glossary +# Cache-busting token for static assets. Computed once at import time +# (i.e. process startup), so every container restart yields a fresh +# value and browsers refetch CSS/JS instead of serving stale cache. +# Templates append `?v={{ ASSET_VERSION }}` to every static URL. +ASSET_VERSION = str(int(time.time())) + + TEMPLATE_DIR = Path(__file__).resolve().parent / "templates" @@ -77,3 +85,4 @@ templates.env.globals["LEGAL_OPERATOR"] = branding.LEGAL_OPERATOR templates.env.globals["OPERATOR_EMAIL"] = branding.OPERATOR_EMAIL templates.env.globals["OPERATOR_JURISDICTION"] = branding.OPERATOR_JURISDICTION templates.env.globals["BETA_MODE"] = get_settings().BETA_MODE +templates.env.globals["ASSET_VERSION"] = ASSET_VERSION