diff --git a/scripts/release.py b/scripts/release.py
index e2daf0f..aacdf7f 100755
--- a/scripts/release.py
+++ b/scripts/release.py
@@ -32,9 +32,31 @@ from pathlib import Path
REPO_ROOT = Path(__file__).parent.parent
VERSION_FILE = REPO_ROOT / "VERSION"
CHANGELOG_FILE = REPO_ROOT / "CHANGELOG.md"
+INDEX_HTML_FILE = REPO_ROOT / "static" / "index.html"
GITHUB_REPO = "mARTin-B78/tts-voice-creator-clone-and-design-2"
GITHUB_BASE = f"https://github.com/{GITHUB_REPO}"
+# static/index.html hardcodes ?v= cache-busting query strings on style.css,
+# the per-page CSS files and loader.js, plus an
+# tag. Nothing previously kept these in sync with VERSION, so they silently
+# drifted to different stale versions each (seen live: style.css one release
+# behind, loader.js sixteen releases behind) -- StaticCacheHeadersMiddleware
+# in server.py marks any *.css/js request WITH a ?v= query
+# "Cache-Control: public, max-age=31536000, immutable", so once a browser
+# had fetched e.g. magazine.js?v=1.26.10 it kept serving that exact response
+# for a year regardless of how many times the file changed on disk or how
+# hard the page was reloaded. Rewriting every ?v=X.Y.Z to the new version on
+# every release is what actually invalidates that cache.
+_VERSION_QUERY_RE = re.compile(r"(\?v=)\d+\.\d+\.\d+")
+_APP_VERSION_META_RE = re.compile(r'( str:
+ html = INDEX_HTML_FILE.read_text()
+ html = _VERSION_QUERY_RE.sub(rf"\g<1>{new_str}", html)
+ html = _APP_VERSION_META_RE.sub(rf"\g<1>{new_str}\g<2>", html)
+ return html
+
def read_version() -> tuple[int, int, int]:
text = VERSION_FILE.read_text().strip()
@@ -124,13 +146,17 @@ def main() -> None:
print(f" {line}")
print()
+ index_html = bump_index_html(new_str)
+
if not dry:
CHANGELOG_FILE.write_text(changelog)
VERSION_FILE.write_text(new_str + "\n")
+ INDEX_HTML_FILE.write_text(index_html)
print(f" ✓ Wrote VERSION → {new_str}")
print(f" ✓ Wrote CHANGELOG.md")
+ print(f" ✓ Wrote static/index.html cache-busting tags → {new_str}")
- git("add", "VERSION", "CHANGELOG.md")
+ git("add", "VERSION", "CHANGELOG.md", "static/index.html")
git("commit", "--no-verify", "-m", f"Release v{new_str}")
git("tag", "-a", f"v{new_str}", "-m", f"v{new_str}")