You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)]
pubstructSizeAbove(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.
The text was updated successfully, but these errors were encountered:
Feature Request
Currently,
SizeAbove
has au16
inside of it to limit the size where compression is active.It would be handy if a larger type (like
u64
) was used instead.tower-http/tower-http/src/compression/predicate.rs
Lines 147 to 149 in 4bca529
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
tou64
. There are no obvious drawbacks apparent for me.If you would like to make this change I can implement it if you want.
The text was updated successfully, but these errors were encountered: