Skip to content

perf(website): version WASM service worker cache key to prevent stale binary #403

@ajitpratap0

Description

@ajitpratap0

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:

  1. 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})
  2. Use a cache key that includes the Next.js build ID (e.g. gosqlx-wasm-${NEXT_PUBLIC_BUILD_ID})

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions