Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Brotli instead of Gzip #253

Open
C0Nd3Mnd opened this issue Oct 26, 2021 · 3 comments
Open

Use Brotli instead of Gzip #253

C0Nd3Mnd opened this issue Oct 26, 2021 · 3 comments

Comments

@C0Nd3Mnd
Copy link

Is your feature request related to a problem? Please describe.
Considering that Brotli is supported by every major browser these days you should consider using it instead of Gzip. In my tests, JSON generated by BlueMap compressed around 20-30% smaller with Brotli compared to Gzip. This saves a lot of space storing the map and a lot of bandwidth serving the map.

Describe the solution you'd like
Enable Brotli compression to replace Gzip compression by default (or make it configurable). Existing Gzip files should either be unzipped and compressed again with Brotli as some sort of migration, or the map should re-render again (both are fine probably).

@TBlueF
Copy link
Member

TBlueF commented Oct 26, 2021

The problem with brotli compression is that browsers only accept brotli from an encrypted connection. By default BlueMap-Maps are http.
There is already a fork that implemented brotli: https://github.com/NikitaCartes/BlueMap/tree/feature/brotli
And adding brotli-compression as an option is also already on the TODO. It will not be default tho :)

@BuIlDaLiBlE
Copy link

I'm very much interested in this as I'm using a proxy server with TLS anyway.

@FinlayDaG33k
Copy link

FinlayDaG33k commented Aug 16, 2023

I'm using a proxy server with TLS anyway

Most likely, you can use the proxy server to re-compress it as Brotli (not ideal but it should work).

What I personally did is use no compression with an external webserver (Bluemap puts it on a MySQL server and an external webserver gets it from there).
Then just let the external webserver handle compression.
It does take a bit more resources so you'll have to think for yourself whether it's worth it.
You could move the external webserver + MySQL on a completely different box to not have your Minecraft server deal with it (and disable the built-in webserver completely).
That also means your map will remain available while your server goes down (eg. maintenance) but is a more complex setup (I'd be willing to write a guide on this if demand is there).

Please do note that png files don't always compress that well.
afbeelding
afbeelding

I would agree that the option for Brotli in the plugin itself would be nice but it can be achieved right now as well, just... with some extra steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Planned (unordered)
Development

No branches or pull requests

4 participants