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

feat(compress): improve compress middleware #3317

Merged
merged 12 commits into from
Aug 28, 2024

Conversation

nitedani
Copy link
Contributor

@nitedani nitedani commented Aug 23, 2024

Improvements:

  • Content-Length threshold for compression
  • Handling of already compressed responses
  • Cache-Control: no-transform handling
  • Handling of custom Content-Type headers

Fixes:

Copy link
Member

@usualoma usualoma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the pull request! I think this pull request will greatly improve the "compress" middleware.

I've made some comments and hoped you could check them.

src/middleware/compress/index.ts Outdated Show resolved Hide resolved
src/middleware/compress/index.ts Outdated Show resolved Hide resolved
src/middleware/compress/index.ts Outdated Show resolved Hide resolved
@nitedani
Copy link
Contributor Author

Thank you too :) Pushed the changes.

Copy link
Member

@usualoma usualoma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@nitedani nitedani changed the title improve compression middleware feat(compress): improve compress middleware Aug 27, 2024
Copy link

codecov bot commented Aug 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.31%. Comparing base (d1c7f6f) to head (f2de818).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3317   +/-   ##
=======================================
  Coverage   96.31%   96.31%           
=======================================
  Files         151      151           
  Lines       15368    15401   +33     
  Branches     2693     2696    +3     
=======================================
+ Hits        14801    14834   +33     
  Misses        567      567           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yusukebe
Copy link
Member

Hi @nitedani

Awesome improvement! I'll merge this into the main and include it in the next patch release. Thank you!

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

Successfully merging this pull request may close these issues.

3 participants