Performance Auditor — checks whether
Content-Encoding advertises a recommended compression coding.Performance
Gzip, Deflate, Brotli, and Zstandard shrink HTML and other text so pages transfer faster.
Compatibility
Header syntax follows RFC 9110 §8.4; stacked encodings in one field are valid.
Accept-Encoding: gzip, deflate, br, zstd and inspects Content-Encoding. It does not decompress the body or verify that the bytes match the declared coding.
How it works
The auditor judges compression readiness from theContent-Encoding header:
- Parse — requires a URL with a scheme and hostname. Invalid or empty URLs error.
- Fetch — reads response headers with
HeadersCrawler, asking for Gzip, Deflate, Brotli, and Zstandard. EveryContent-Encodingfield is collected and split on commas. - Rules — a missing header is a FAIL. A coding other than
gzip,deflate,br, orzstdis a WARNING. More than oneContent-Encodingfield is a WARNING. - Aggregate —
ERRORwins, thenFAIL, thenWARNING; if every rule passes, the audit isSUCCESS. - Specification pin — every run emits
37A-ContentEncodingAuditor-100(INFORMATION) naming HTTP Content-Encoding RFC 9110 §8.4 (2022-06). That check does not change overall status.
Gzip (gzip) or Brotli (br).
What it audits
Every row maps to onecheckRule* method and one CheckCode. 37A-ContentEncodingAuditor-100 is emitted on every run, including fetch errors. The unknown-coding WARNING (300) is skipped when the header itself is missing (400). CheckCode suffixes use status ranges: 100 information, 200 success, 300–399 warning, 400–499 fail, 500–599 error.
Output documentation
Risks and considerations
Uncompressed responses cost bandwidth
- HTML, CSS, JavaScript, and JSON shrink substantially under Gzip, Brotli, or Zstandard. Serving them uncompressed increases transfer time and hosting cost.
- Mobile and high-latency clients are hit hardest when
Content-Encodingis missing.
Unknown or stacked encodings
identitymeans no transformation; clients receive uncompressed bytes even though the header is present.compressis a registered coding but is poorly supported. Prefer Gzip, Brotli, or Zstandard.- RFC 9110 allows stacked encodings in one comma-separated field (
gzip, br). Sending the same header twice is ambiguous for intermediaries.
What this auditor does not check
- The body is not decompressed. A
Content-Encoding: gzipheader on uncompressed bytes will still succeed. - Transfer-Encoding (
chunked) is not judged here. - Image, video, and already-compressed binary assets are often left uncompressed on purpose; this auditor still expects
Content-Encodingon the audited URL.