-
Notifications
You must be signed in to change notification settings - Fork 216
Expose compression level on CompressionLayer #245
Copy link
Copy link
Closed
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.E-easyCall for participation: Experience needed to fix: Easy / not muchCall for participation: Experience needed to fix: Easy / not muchE-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.E-easyCall for participation: Experience needed to fix: Easy / not muchCall for participation: Experience needed to fix: Easy / not muchE-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.
Feature Request
Motivation
Being able to set the compression level will allow one to tweak the settings for optimal speed/compression.
It can be quite a big difference in speed mostly, especially if things are at max.
Proposal
My thoughts are that
with_qualityis exposed fromasync_compression.https://docs.rs/async-compression/latest/src/async_compression/macros.rs.html#19
The interesting one is the
Level::Preciseso just having access to that should give much of the customizationhttps://docs.rs/async-compression/latest/src/async_compression/lib.rs.html#208
Alternatives
Haven't tried it but i guess one could manually implement their own compression layer,
or do the compression in the request handler.
I believe it would be quite unnecessary to do that workaround when there's already a
CompressionLayeravailable.:)