devpunks / snuggsi

snuggsi ツ - Easy Custom Elements in ~1kB
https://snuggsi.com
MIT License
398 stars 17 forks source link

Zopfli zlib (& testing gzip) for HTTP Compression Negotiation #96

Closed snuggs closed 7 years ago

snuggs commented 7 years ago

Summary

Haven't found a sane gzip cli in node and don't really feel need a programing environment for this. Just a good command line script with decent args that I don't have to manually build and install. Zopfli covers both. Also determining using gzip (current manually installed library) vs zopfli libraries for GZIP compression (also testing ZLIB compression with Zopfli).

Reason

  1. gzip node library doesn't have a good command line. Forces authoring JS 💩
  2. Personal gain
  3. Being asked for documentation so at minimum README.md will be super valuable for links.

Satisfies Content Negotiation for br, gzip, deflate [Accept-Encoding]() advertisements for Content-Encoding tokens respectively for graceful degradation.

https://en.wikipedia.org/wiki/HTTP_compression

Background Dependencies

Result

  1. No need for manual installation of gzip make/installation anymore.
  2. 💰 7% savings in DEFLATEd compression libraries. 💸
  3. Stopped diff of gzip versions on every run. (Now is idempotent).
  4. Better understanding of "Content Encoding Negotiation"
  5. The browser warz back in the bad old dayz were shitty for everyone. One word... GREED!
brandondees commented 7 years ago

the diff implies that you have zopfli and brotli confused. i don't think you'd want to mix them together. zopfli is gzip compatible output but trading compress time for size savings. brotli is an entirely different, incompatible compression and has to be treated separately.

snuggs commented 7 years ago

@brandondees testing gzip differences not brotli. Disabling brotli while testing. Will have both gzip and zopfli versions in for a bit while testing server payloads.

Hope this clears things up.

snuggs commented 7 years ago

Jus testing.

gzip, zlib, deflate (respectfully) capture d ecran 2017-07-09 a 10 17 19

snuggs commented 7 years ago

Conclusion

Switching over to using zopfli 🏆 for gzip compression.

capture d ecran 2017-07-09 a 11 49 05

snuggs commented 7 years ago

@tmornini just a heads up! Says you recently updated here.

capture d ecran 2017-07-09 a 14 24 21

brandondees commented 7 years ago

thanks for the clarification, all makes sense now.