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 gzip to zip request response #114

Open
tvd12 opened this issue Jul 27, 2023 · 3 comments
Open

Use gzip to zip request response #114

tvd12 opened this issue Jul 27, 2023 · 3 comments
Assignees

Comments

@tvd12
Copy link
Member

tvd12 commented Jul 27, 2023

zip request, response has size > 1500 bytes

@tvd12 tvd12 self-assigned this Jul 27, 2023
@anaconda875
Copy link

In http, we have Content-Encoding, Accept-Encoding headers to decide whether we should compress/uncompress the data and the codec to do that (gzip is a case). Is there any equivalent in Socket?
I think we should not force user using gzip or 1500b threshold, they can choose deflate, gzip, identity based on their need. Just provide them a configuration and let them decide which is best for them

@tvd12
Copy link
Member Author

tvd12 commented Mar 14, 2024

@anaconda875

  1. No, it's depending header of package, you can take a look here.
  2. yes, gzip should be optional.

@anaconda875
Copy link

anaconda875 commented Mar 14, 2024

So please consider this simple scenario:
Add one more bit to req header: respCompressionRequired default false. If true, server will use gzip to compress resp (only gzip), don't care about 1500bytes.
Add one more bit isCompressed to resp header.
In client sdk, add 2 configuration:

  • reqCompressionRequired defaul false. If true, client compress req before sending.
  • respCompressionRequired default false. Use it to turn the bit on/off.

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

2 participants