Achieve RFC 9110 Content Negotiation
Created November 6, 2026 · Updated November 6, 2026 · Achieve 3.1.0 · Qualified runtime: Node.js 24.22.2
Requirement levels: Applicable content-coding and selection rules include MUST, SHOULD, and MUST NOT obligations.
Achieve negotiates identity, gzip, and deflate representations for eligible static resources when compression is enabled. Negotiation selects the representation for the response; generation and maintenance of compressed artifacts are described separately in Static Compression.
Applicable requirements
- MUST: Under RFC 9110 §8.4.1, a sender applying a content coding must list it in
Content-Encodingin application order. - SHOULD: Under §12.5.3, when no acceptable content coding is available, an origin server should send identity unless the request makes identity unacceptable.
- Defined selection semantics: Under §12.4.2, a quality value of zero means a coding is not acceptable; the most specific matching field value determines its quality.
- SHOULD: Under §12.5.5, an origin server should generate
Varyon a cacheable response intended for selective reuse based on request fields.
Representation selection
Achieve parses Accept-Encoding case-insensitively, including quality values and *. It ignores malformed members and unsupported codings, honors explicit exclusions, and selects the available supported representation with the highest quality. Identity has its normal implicit acceptability unless explicitly excluded. When gzip and deflate have equal quality, Achieve prefers gzip.
If the best compressed representation has not yet been generated and identity is acceptable, Achieve sends identity and schedules artifact generation. If every supported representation, including identity, is unacceptable, it returns 406 Not Acceptable.
Response metadata
A gzip or deflate response carries the corresponding Content-Encoding; identity does not. Content-Length, validators, and modification metadata describe the representation actually sent. Strong entity tags have distinct identity, gzip, and deflate markers. Achieve sends Vary: Accept-Encoding whenever its static compression selection can vary by that request field, including 304 and 406 paths.
Verification
The compression and conditional suites cover quality ordering, wildcard and explicit precedence, duplicate and malformed members, unsupported codings, identity defaults and exclusions, 406, gzip/deflate metadata, representation-specific entity tags, Vary, HEAD, and fallback when an artifact cannot be opened.
Limits
Achieve supports gzip and deflate, not Brotli. Automatic compression applies to eligible ordinary static text/* and application/* resources; media range responses and servlet-generated content are not automatically compressed. Application-authored negotiation remains the application's responsibility.
