Skip to content

docs(compression): minBodyBytes default mismatch — doc says 1 KB, code uses 512 #167

Description

@momics

Summary

docs/features/compression.md documents compression.minBodyBytes as default 1 KB, but the actual default in the Rust core is 512 bytes (crates/iroh-http-core/src/config.rsmin_body_bytes: usize with Default: 512). Fix the doc to match the code (or change the code if 1 KB is intended).

Evidence

  • Doc (docs/features/compression.md line 19): minBodyBytes: 1024, // skip compression below this size (default 1 KB)
  • Code (crates/iroh-http-core/src/config.rs): default constant is 512.
  • The Node FFI bridge (packages/iroh-http-node/src/lib.rs line 420) also defaults to 512 when compressionMinBodyBytes is None.

Impact

Cosmetic: developers tuning compression behaviour read the doc, expect compression to skip bodies below 1 KB, and instead see compression on bodies between 512 B and 1 KB.

Remediation

Two options — pick one:

  1. Fix the doc to say default 512 bytes (lowest-friction).
  2. Change the default to 1 KB in config.rs and the Node bridge (matches the convention used by most HTTP servers; the tower-http SizeAbove predicate's built-in default is 32 but most servers tune higher).

Acceptance criteria

  • Documented default and code default agree.
  • A CompressionOptions::default() test asserts the value (regression guard).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4documentationImprovements or additions to documentationrustPull requests that update rust code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions