implement cache busting
Implements cache busting for
- caniuse_rs.wasm 🡒 caniuse_rs.{build_id}.wasm
- caniuse_rs.js 🡒 caniuse_rs.{build_id}.js
- style.css 🡒 style.{build_id}.css
This is done with a Tera variable and a Rollup banner containing the build id, which is the timestamp of the build.
Unfortunately, this pollutes the public folder over time since old assets aren't removed. If you know a solution, LMK.
Perhaps it would be better to use Vite, which has cache busting built in.
Thanks, but I don't really think changing the file names should be required. It's probably a matter of setting the right cache-control header, setting up ETag, or something like that.
You can disable the browser cache with Cache-Control: no-cache. The downside is that consecutive page loads will be slightly slower because of this.
By embedding an id or checksum in the file name, caching still works, but you never get an outdated version of the file.