Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASM binary hash included in the filename of .wasm and .js #1447

Open
Slixe opened this issue Nov 7, 2024 · 0 comments
Open

WASM binary hash included in the filename of .wasm and .js #1447

Slixe opened this issue Nov 7, 2024 · 0 comments

Comments

@Slixe
Copy link

Slixe commented Nov 7, 2024

💡 Feature description

Due to some cache issues from browsers, when we do an update by replacing the WASM binary and its JS binding file, even by clearing the cache of the browser, sometimes the WASM isn't updated, same for JS file and this can create unexpected errors.

The proposal is to add a feature/option when building with wasm-pack to append the hash of (WASM + JS) in the filename of both to be sure that the browser will ALWAYS refetch the new files without relying on the cache.

💻 Basic example

Create a web application using WASM, you make a new version and you upload it to your website again, but unfortunately, the browser keep the old version, and sometimes even when you clear the browser cache or due to Cloudflare cache too.

Having a hash would make any update much easier for web applications.

A custom script could be done to have such behavior, but maybe having a feature directly in wasm-pack would be much better as I'm sure others would appreciate it.

cc @fzyzcjy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant