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

Use starlette-cramjam compression middleware #312

Closed
vincentsarago opened this issue May 7, 2021 · 4 comments · Fixed by #369
Closed

Use starlette-cramjam compression middleware #312

vincentsarago opened this issue May 7, 2021 · 4 comments · Fixed by #369
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@vincentsarago
Copy link
Member

link: https://github.com/milesgranger/pyrus-cramjam

right now we have to install brotli dependency and use default middleware which is not customizable (ref #268)

I think we could create a simple middleware which support zlib and brotli using pyrus-cramjam and also add a path filter as we've done in #297

@vincentsarago vincentsarago added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels May 7, 2021
@kylebarron
Copy link
Member

I think we could create a simple middleware which support zlib and brotli using pyrus-cramjam and also add a path filter as we've done in #297

Are these two different issues? One to change the compression implementation from the defaults to a third party package, and a separate one to add a path filter to the middleware? Seems like you could subclass the existing middleware to add a path filter without changing the compression implementation?

@vincentsarago
Copy link
Member Author

@kylebarron it's kinda 2 issues in one

  1. we need a custom middleware to filter based on path or media type
  2. we need one solution that could support brotli and zlib

Creating a brand new middleware based on pyrus-cramjam will let us do what ever we think is good ;-)

@vincentsarago
Copy link
Member Author

I started something over https://github.com/developmentseed/starlette-cramjam but for now I'm blocked at making streamed response working!

@vincentsarago
Copy link
Member Author

💥 https://pypi.org/project/starlette-cramjam/0.1.0a0/ thanks a lot to @milesgranger for his great help 🙏

@vincentsarago vincentsarago changed the title Create compression middleware using pyrus-cramjam Use starlette-cramjam compression middleware Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants