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

Multi-encoder proposal #5

Open
cseufert opened this issue Jul 13, 2021 · 1 comment
Open

Multi-encoder proposal #5

cseufert opened this issue Jul 13, 2021 · 1 comment

Comments

@cseufert
Copy link

To support deflate, gzip, brotli and zstd compression, it currently requires stacking the middleware, which means that each request needs to go through up to 4 middleware, which means 3 extra stack frames to wade through when debugging, etc.

I propose we refactor the middleware a CompressionEncoder class that takes a list of compressors, in your preferred priority order, and the middleware finds the first supported compressor and encodes the output accordingly.

We can then provide API compatible shim classes for backwards compatibility that extend/wrap the CompressionEncoder class, and configured it with deflate/gzip accordingly.

I am going to implement this internally and was wondering if you are interested in merging it as a v3.0 type feature.

@cseufert
Copy link
Author

Have put together a basic idea of what this could be in #6

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