Skip to content

Conversation

@nico-martin
Copy link
Collaborator

This adds caching of the wasm Binary.
I also added an env.cacheKey so developers can modify the cacheKey. By default it will be transformers-cache but they are free to set something related to their app.

Note: this will only cache the wasm file. So there will still be a request to https://cdn.jsdelivr.net/ for the mjs file. In my opinion, this should be cached via the service-worker if the applications requires full offline support.

@nico-martin nico-martin requested a review from xenova December 1, 2025 14:30
@xenova
Copy link
Collaborator

xenova commented Dec 1, 2025

So there will still be a request to https://cdn.jsdelivr.net/ for the mjs file. In my opinion, this should be cached via the service-worker if the applications requires full offline support.

Indeed, caching the mjs file would be necessary to ensure full offline support, and imo is essential before adding a caching feature like this PR proposes. Any ideas for how we could do this? Perhaps bundling ort-wasm-simd-threaded.jsep.mjs with transformers.js file?

@nico-martin nico-martin changed the title added wasm cache [v4] added wasm cache Dec 2, 2025
Copy link
Collaborator

@xenova xenova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice + clean PR! Now we just need to figure out how to completely remove the ort-wasm-simd-threaded.jsep.mjs dependency.

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

Successfully merging this pull request may close these issues.

3 participants