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

Switch default encoding to gzip for now #1260

Merged
merged 2 commits into from
May 25, 2024
Merged

Conversation

nyurik
Copy link
Member

@nyurik nyurik commented Mar 17, 2024

GZip is significantly faster, so for now lets use that until brotli project gains some performance, and until we get proper after-compression caching.

@nyurik nyurik enabled auto-merge (squash) March 17, 2024 20:39
@sharkAndshark
Copy link
Collaborator

if tile.info.encoding == Encoding::Uncompressed {
let ordered_encodings = match self.preferred_enc {
Some(PreferredEncoding::Gzip) => PREFER_GZIP_ENC,
Some(PreferredEncoding::Brotli) | None => PREFER_BROTLI_ENC,
};

Seems this should be updated

@sharkAndshark
Copy link
Collaborator

sharkAndshark commented Mar 18, 2024

for (accept_encodings, prefered_encoding, result_encoding) in [
(
Some(AcceptEncoding(vec![
"gzip;q=1".parse().unwrap(),
"br;q=1".parse().unwrap(),
])),
Some(PreferredEncoding::Brotli),
Encoding::Brotli,
),
(
Some(AcceptEncoding(vec![
"gzip;q=1".parse().unwrap(),
"br;q=0.5".parse().unwrap(),
])),
Some(PreferredEncoding::Brotli),
Encoding::Gzip,
),

And maybe more tests should be added or updated here.

@nyurik
Copy link
Member Author

nyurik commented Mar 18, 2024

Thx @sharkAndshark! Turns out it was never properly working -- it was always using the list of accepted encoding and ignored the order of the supported encodings... So we may have to rework that code. I re-worked the tests and removed the confusing default, but this is currently broken. Will try to get back to it soonish

@nyurik nyurik force-pushed the gzip-default branch 3 times, most recently from 21a0164 to 92bfa82 Compare April 10, 2024 02:21
@sharkAndshark
Copy link
Collaborator

Hi @nyurik I make a PR to this, Could you give it a review?

GZip is significantly faster, so for now lets use that until brotli project gains some performance, and until we get proper after-compression caching.
@nyurik nyurik merged commit 81f4d4c into maplibre:main May 25, 2024
14 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants