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

Support for larger sizes in compression::predicate::SizeAbove #525

Open
1 task done
liss-h opened this issue Oct 2, 2024 · 0 comments
Open
1 task done

Support for larger sizes in compression::predicate::SizeAbove #525

liss-h opened this issue Oct 2, 2024 · 0 comments

Comments

@liss-h
Copy link

liss-h commented Oct 2, 2024

  • I have looked for existing issues (including closed) about this

Feature Request

Currently, SizeAbove has a u16 inside of it to limit the size where compression is active.
It would be handy if a larger type (like u64) was used instead.

/// [`Predicate`] that will only allow compression of responses above a certain size.
#[derive(Clone, Copy, Debug)]
pub struct SizeAbove(u16);

Motivation

Since the size is in bytes 2^16 bytes is still quite small (64KiB), when the internet connection is fast enough it does not really make sense to compress payloads that small. So if you don't want to compress payloads that small you currently just have to reimplement the same thing, which is not ideal.

Proposal

Increase the type size from u16 to u64. There are no obvious drawbacks apparent for me.
If you would like to make this change I can implement it if you want.

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

No branches or pull requests

1 participant