build: content-hash cache-busting for local CSS/JS (?v=hash)
Deploy to Production on Develop Push / deploy (push) Successful in 20s

Stops deploys being served stale from browser cache — the recurring "changes
do not show up until a hard refresh" problem.

- New tools/cache_bust.py stamps a global content hash onto every local
  <link>/<script> CSS/JS ref AND the @import lines in css/main.css (so partial
  edits bust too). External (https://) refs are untouched. Deterministic and
  idempotent: same content -> same stamp, any asset edit -> new stamp sitewide.
- Wired as the final step of tools/build_site.py so every build/deploy stamps.
- Initial stamp applied across 259 pages + main.css (v=64a53dd6).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
popovskikandClaude Opus 4.8 committed 2026-08-27 18:14:44 +02:00
1 parent 7c2110d8a5
commit 954f186761
262 files changed
+1518 -1435

No files matched your search

+3
View File
@@ -37,6 +37,9 @@ BUILD_STEPS = [
("Inject SEO + rebuild sitemap/robots", ["tools/seo_inject.py", "--all", "--sitemap"]),
("Rebuild bot/AI discovery files", ["tools/build_botlinks.py"]),
("Rebuild offline assistant search index", ["tools/build_search_index.py"]),
# Last: stamp a content-hash ?v= on local CSS/JS refs so deploys aren't
# served stale from cache. Must run after every step that writes pages.
("Cache-bust CSS/JS references", ["tools/cache_bust.py"]),
]
IMAGES_STEP = ("Optimise images to WebP + update refs", ["optimize_images.py"])
CHECK_STEP = ("Verify rendered pages match content/", ["tools/build_content.py", "--check"])