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

Buffer data before sending it to the compressors #41

Open
CAFxX opened this issue Sep 7, 2023 · 0 comments
Open

Buffer data before sending it to the compressors #41

CAFxX opened this issue Sep 7, 2023 · 0 comments

Comments

@CAFxX
Copy link
Owner

CAFxX commented Sep 7, 2023

Compressors generally operate faster if they are provided with large chunks of data.

There is already a small buffer, but it's only used for content-type sniffing before compression start (and is bypassed entirely once compression has started).

We could instead replace it with a buffer of configurable size (by default larger than the current content-type sniffing one) that would be used also during compression to compress data in larger chunks.

Some compressors may do the same internally, so we would need to avoid double buffering in this case.

Such a buffer could later also be used to capture the full uncompressed payload of (small) responses, that paired together with the resulting compressed payload could be cached to avoid having to recompress the same data over and over.

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

1 participant