Skip to content

Commit

Permalink
Use new behaviour to compress headers/body separately
Browse files Browse the repository at this point in the history
  • Loading branch information
khvzak committed Nov 13, 2023
1 parent e73e6de commit 024680c
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions casper-server/src/storage/backends/redis/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use crate::utils::zstd::{compress_with_zstd, decompress_with_zstd, ZstdDecoder};
const SURROGATE_KEYS_TTL: i64 = 86400; // 1 day

// Do not compress data less than 100 bytes
const _COMPRESSION_THRESHOLD: usize = 100;
const COMPRESSION_THRESHOLD: usize = 100;

#[derive(Clone)]
pub struct RedisBackend {
Expand Down Expand Up @@ -393,15 +393,6 @@ impl RedisBackend {
// If compression level is set, compress the body and headers and update flags
let mut flags = Flags::default();
if let Some(level) = self.config.compression_level {
// Temporary use old compression behavior for compatibility
(headers, body) = try_join(
compress_with_zstd(headers, level),
compress_with_zstd(body, level),
)
.await?;
flags |= EX_COMPRESSED;

/*
let (headers_comp, body_comp);
if body.len() < COMPRESSION_THRESHOLD {
// Compress only headers if the body is too small
Expand All @@ -422,7 +413,6 @@ impl RedisBackend {
body = body_comp;
flags |= BODY_COMPRESSED;
}
*/
}

// If encryption is enabled, encrypt the body and headers and update flags
Expand Down

0 comments on commit 024680c

Please sign in to comment.