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

docs: fix default zlib level #234

Merged
merged 1 commit into from
Jun 18, 2022
Merged

docs: fix default zlib level #234

merged 1 commit into from
Jun 18, 2022

Conversation

markwainwright
Copy link
Contributor

@markwainwright markwainwright commented Jun 16, 2022

This isn't well-covered in the Node docs, but zlib's level actually defaults to zlib.constants.Z_DEFAULT_COMPRESSION (-1), which zlib resolves to 6, not 9:

Z_DEFAULT_COMPRESSION requests a default compromise between speed and compression (currently equivalent to level 6).
(https://www.zlib.net/manual.html#Basic)

Checklist

README.md Outdated
@@ -163,7 +163,7 @@ You can tune compression by setting the `brotliOptions` and `zlibOptions` proper
},
},
zlibOptions: {
level: 9, // default is 9, max is 9, min is 0
level: 9, // default is typically 6, max is 9, min is 0
Copy link
Member

Choose a reason for hiding this comment

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

I would change the value to default as well.

Suggested change
level: 9, // default is typically 6, max is 9, min is 0
level: 6, // default is typically 6, max is 9, min is 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense! Done

@mcollina mcollina merged commit 06ced0e into fastify:master Jun 18, 2022
@markwainwright markwainwright deleted the docs-zlib-default-level branch June 24, 2022 05:33
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.

3 participants