nytimes / gziphandler

Go middleware to gzip HTTP responses
https://godoc.org/github.com/NYTimes/gziphandler
Apache License 2.0
868 stars 129 forks source link

Refactor out gzipwriter interface #106

Open whs opened 4 years ago

whs commented 4 years ago

I've implemented a cloudflare-zlib backend for gziphandler. This PR allows for swappable writer implementation to allow people who doesn't want to depend on native module to continue using compress/gzip.

We've been using this in production at @wongnai for 6 months (although we use the build flag to swap implementations, not interface) and as mentioned in #94, it reduces the CPU usage by 43%

Another PR will be open soon to add the zlib implementation once the forked cloudflare-zlib is open source.

closes #94

whs commented 3 years ago

Updated according to reviews