ord
ord copied to clipboard
Add brotli compression for text-based inscriptions
TODO:
- [x] Add more tests
- [ ] Have users configure compressor parameters?
You can add a bool to Media::TABLE, true for text formats and false for non text formats, which determines what should be compressed. Only text should be compressed for now.
Only text should be compressed for now.
I had tested the majority of our existing MIME types to verify which would benefit from brotli. The majority show gains with the 3d types being exceptionally well suited for compression.
I hope this will be merged someday 🙏
TODO (to get this shipped):
- [ ] Switch to dropbox rust brotli implementation (https://docs.rs/brotli/latest/brotli/)
- [ ] Handle these tests:
- [ ] subcommand::server::tests::responses_are_brotlied
- [ ] subcommand::server::tests::text_preview
- [ ] subcommand::server::tests::text_preview_returns_error_when_content_is_not_utf8
- [ ] subcommand::server::tests::text_preview_text_is_escaped