Skip to content

option for custom deflaters#2393

Closed
alexanderadam wants to merge 1 commit into
rack:mainfrom
alexanderadam:feat/deflater_option_for_custom_deflaters
Closed

option for custom deflaters#2393
alexanderadam wants to merge 1 commit into
rack:mainfrom
alexanderadam:feat/deflater_option_for_custom_deflaters

Conversation

@alexanderadam

@alexanderadam alexanderadam commented Oct 14, 2025

Copy link
Copy Markdown
Contributor

EDIT: I deleted my fork again and this action closed this PR here. I created PR #2399. Sorry for the inconvenience.

Hi folks,

I hope that it is open that I gave it a try? 🫣
Basically this is how I understood Jeremy's comment in the issue 2168.

The basic usage with Zstd would be

use Rack::Deflater, deflaters: {
  "zstd" => lambda { |headers, body| ZstdStream.new(body) }
}

Thank you so much for maintaining Rack! 🙏

@jeremyevans jeremyevans left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for working on this.

Comment thread lib/rack/deflater.rb Outdated
Comment thread test/spec_deflater.rb Outdated
Comment thread test/spec_deflater.rb Outdated
@alexanderadam

Copy link
Copy Markdown
Contributor Author

Thank you so much for the fast feedback! 🙏

@jeremyevans jeremyevans left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, just have a few minor tweaks requested.

Comment thread lib/rack/deflater.rb
Comment thread lib/rack/deflater.rb Outdated
Comment thread lib/rack/deflater.rb Outdated
See also Jeremy's comment in the issue:

#2168 (comment)

Basic usage with Zstd (https://github.com/SpringMT/zstd-ruby)

use Rack::Deflater, deflaters: {
  "zstd" => lambda { |headers, body| ZstdStream.new(body) }
}

Multiple custom deflaters:

use Rack::Deflater, deflaters: {
  "zstd" => zstd_deflater,
  "br"   => brotli_deflater
}

refs #2168
@alexanderadam

Copy link
Copy Markdown
Contributor Author

Thank you for your feedback. I'm not used to get feedback so quickly.

That's wonderfully refreshing 🙏

@jeremyevans jeremyevans requested a review from ioquatix October 15, 2025 15:49
@alexanderadam alexanderadam closed this by deleting the head repository Oct 22, 2025
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.

2 participants