Problem
wasm-sw.js uses a static cache key (gosqlx-wasm-v1). After deploying a new gosqlx.wasm binary, users will continue receiving the cached old binary until they manually clear their browser cache.
Fix
Inject a build-time hash into the cache key. Options:
- Generate the hash from the WASM binary in the build process and pass it as an env var (e.g.
gosqlx-wasm-v${WASM_HASH})
- Use a cache key that includes the Next.js build ID (e.g.
gosqlx-wasm-${NEXT_PUBLIC_BUILD_ID})