WICG / webpackage

Web packaging format
Other
1.22k stars 114 forks source link

go/bundle explain how to use gzip with this #841

Open gaycodegal opened 1 year ago

gaycodegal commented 1 year ago

Web bundles have header information, I know gzip packaging uses headers to help work, and web bundle is definitely not compressed by default as zip vs wbn comparisons I've done shows wbn is larger by a decent amount.

Part of the states goal of web bundles is to work in areas with little internet. Typically this comes hand in hand with low on device storage. Thus, I think gzipping the contents of a web bundle probably would make a user more willing to use and keep these files. I'm not familiar enough with the format to know how to do that, but it would be a good tutorial to publish to help app makers get the most out of the format.

From my comparison I zipped a pico8 game called lava joe and it was 557KB, whereas the wbn version was 1.81 MB. I also ran into an issue where the game didn't run to well in web bundle format because navigation to different url #fragment broke it in chrome, but I'll assume it would have worked without this

sonkkeli commented 11 months ago

To overcome this (as it's not supported by this Golang tool at least for now), you could use the webpack plugin version of web bundle generator together with this Webpack compression plugin which supports gzipping before "webbundling" the code.