Skip to content

Commit

Permalink
Best gzip compression, updated brotli (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
marlonbaeten authored Apr 30, 2024
1 parent acedf71 commit ab14bfe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion memory-serve-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ publish.workspace = true
proc-macro = true

[dependencies]
brotli = "5"
brotli = "5.0"
mime_guess = "2.0"
proc-macro2 = "1.0"
sha256 = "1.4"
Expand Down
2 changes: 1 addition & 1 deletion memory-serve/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ publish.workspace = true
description.workspace = true

[dependencies]
brotli = "5"
brotli = "5.0"
flate2 = "1.0"
axum = { version = "0.7", default-features = false }
memory-serve-macros = { version = "0.4", path = "../memory-serve-macros" }
Expand Down
2 changes: 1 addition & 1 deletion memory-serve/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub(crate) fn compress_brotli(input: &[u8]) -> Option<Vec<u8>> {
}

pub(crate) fn compress_gzip(input: &[u8]) -> Option<Vec<u8>> {
let mut writer = flate2::write::GzEncoder::new(Vec::new(), flate2::Compression::default());
let mut writer = flate2::write::GzEncoder::new(Vec::new(), flate2::Compression::best());
writer.write_all(input).ok()?;

writer.finish().ok()
Expand Down

0 comments on commit ab14bfe

Please sign in to comment.