Replies: 2 comments 2 replies
-
Would it be possible to server the wasm file from a server with gzip/brotli compression which would be handled transparently by the browser? Or is that not enough compression? |
Beta Was this translation helpful? Give feedback.
2 replies
-
I think it could make sense to add a flag about compression, or probably more general allow a custom callback to provide the actual payload. I don't see this exactly end-to-end, but has to be viable. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Possibly related:
I want to deploy evidence.dev on cloudflare pages or workers. When I build my evidence app, it outputs a static site. One of the largest files in the output is a duckdb.wasm, which evidence bundles for the browser to use. This is 34 MB. When I try to deploy this site to cloudflare pages or workers, I get an error, because cloudflare has a 25MB limit for static files. If you search the evidence.dev slack, you can find people coming up with all sorts of absurd workaround for this, like hosting the wasm file on s3 and then rewriting urls with sed.
If I zip the wasm file on my laptop, it is only 7MB. This makes me think it would be possible to:
.wasm.zip
extensionAsyncDuckDB.instantiate(mainModuleURL)
, accept a url that points to this zip file. I assume that all the platforms that the js runs on will have a zlib implementation to do the unzipping on the fly?Then, user code that looks like
could switch to
and everything would work the same, but with less network load, and now duckdb-wasm apps can get deployed on cloudflare.
If you give me a rough outline of how this should be done, I can try to write a PR.
Beta Was this translation helpful? Give feedback.
All reactions