Skip to content
This repository has been archived by the owner on Aug 17, 2018. It is now read-only.

brotli compression #2

Open
godofdream opened this issue Jun 22, 2017 · 8 comments
Open

brotli compression #2

godofdream opened this issue Jun 22, 2017 · 8 comments

Comments

@godofdream
Copy link
Contributor

Many modern Browsers support brotli compression.
We should add optional brotli compression. It does not need to be best compressionlevel.

https://caniuse.com/#search=brotli

@Dexus
Copy link
Contributor

Dexus commented Jun 22, 2017

Some information for this:
https://github.com/kothar/brotli-go (looks like it can used with streams as we need...)

@Dexus
Copy link
Contributor

Dexus commented Jun 29, 2017

I have create a feature/brotli-compression branch, for those that would like implementation it. Please use this repo to push and/or create PRs

@Dexus Dexus added this to the v8 milestone Jun 29, 2017
@Dexus Dexus self-assigned this Jul 6, 2017
@Dexus
Copy link
Contributor

Dexus commented Jul 6, 2017

I start to integrate brotli from https://github.com/google/brotli/tree/master/go/cbrotli
maybe it works as i hope :)

@Dexus
Copy link
Contributor

Dexus commented Jul 6, 2017

any idea how to make it working without compile brotli as lib before?
Can we deliver precompiled pkg's?

@godofdream
Copy link
Contributor Author

caddy has the same issue:
caddyserver/caddy#525

@Dexus
Copy link
Contributor

Dexus commented Jul 6, 2017

okay, so we need to support brotli precompiled files or the users need to compile that them self.

@Allendar
Copy link
Contributor

Allendar commented Jul 6, 2017

Wouldn't it be best to set the compression rate to the highest? Since the power of Brotli it's static system over Gzip's dynamic system. If a file get's compressed and never changes again it probably won't get a recompression. Brotli is much slower than Gzip, but if you Google the benchmarks you can easily get 15~25% more compression than on Gzip.

It kind of reminds me of doing this with Apache years ago under PHP, where you would pre-compress your assets with Grunt on Gzip level 9 and then purely serve the files compressed with the correct headers.

@Dexus
Copy link
Contributor

Dexus commented Jul 6, 2017

For static files you are right, the best compression will be the best, but for dynamic contents it would be the best to use quality 0 to 5. speed vs compression.

Maybe we should also try to implement for static files check for gzip an br accept header and check files with gz or br suffix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants