truku-interactive-lesson / add_cache_busting.py
ILRDF-Lowking's picture
Deploy Truku Interactive Lesson One-Stop System (2026-10-15 14:00:57)
736a4ad verified
Raw History Blame Contribute Delete
373 Bytes
import re
with open('public/index.html', 'r', encoding='utf-8') as f:
html = f.read()
# Add timestamp version query to css and js
html = html.replace('href="css/style.css"', 'href="css/style.css?v=20261010_1955"')
html = html.replace('src="js/app.js"', 'src="js/app.js?v=20261010_1955"')
with open('public/index.html', 'w', encoding='utf-8') as f:
f.write(html)