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

Feature request: target compressed block size #38

Open
subzey opened this issue Oct 14, 2024 · 0 comments
Open

Feature request: target compressed block size #38

subzey opened this issue Oct 14, 2024 · 0 comments

Comments

@subzey
Copy link

subzey commented Oct 14, 2024

It would be great to add a zstd_target_compressed_block_size configuration to control ZSTD_c_targetCBlockSize.


ztsd compresses data in blocks. Any of those blocks can only be decompressed if downloaded entirely. With the default settings, the size of the blocks could be anything <= 128 kB.

Having a block size too large may be bad for incremental parsing of the response. For example, <link rel="stylesheet"> placed inside <head> may not be decompressed at the very start of the response if the block size happen to be larger than CWND × TCP/UDP packet size.

In order to mitigate the issue, the ZSTD_c_targetCBlockSize parameter was added recently:

https://github.com/facebook/zstd/blob/v1.5.6/lib/zstd.h#L394

so that the size of the blocks can be limited. It would be just great to be able to configure that in this nginx module.

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