Download add_cache_busting.py from ILRDF-Lowking/truku-interactive-lesson: direct link, hf CLI and curl.
- Browser
- Download file 373 Bytes
-
https://huggingface.co/spaces/ILRDF-Lowking/truku-interactive-lesson/resolve/main/add_cache_busting.py
- Command line
-
hf download hf://spaces/ILRDF-Lowking/truku-interactive-lesson/add_cache_busting.py
-
curl -L -o add_cache_busting.py https://huggingface.co/spaces/ILRDF-Lowking/truku-interactive-lesson/resolve/main/add_cache_busting.py
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) | |