trillium-static-v0.6.0
Added
-
HTTP Range request support. Every response advertises
Accept-Ranges: bytes. When a client sends a single-rangeRange: bytes=...header
(START-END,START-, or-SUFFIX), the handler seeks into the file
and streams just that byte range with status206 Partial Content,
Content-Range, andContent-Length. Out-of-bounds ranges return416 Requested Range Not SatisfiablewithContent-Range: bytes */N.
Multi-range requests fall through to a200full body. Honors
If-Range(strong-comparison only per RFC 9110); the metadata-derived
etag is weak and so will not satisfyIf-Range, but the
Last-Modifieddate will. Ranged requests bypass precompressed-sidecar
selection — the range applies to the identity representation, never to
a compressed sidecar. -
Precompressed-sidecar serving.
StaticFileHandler::with_precompressed()
serves<asset>.br,<asset>.zst, and<asset>.gzsiblings when the
client'sAccept-Encodingallows them, in that priority order, with
Content-Encodingset and the original asset's MIME type preserved.
Vary: Accept-Encodingis emitted on every response from the handler
while the feature is enabled — including the uncompressed-original
fallback — so caches do not serve a compressed response to a client
that did not ask for one. Composes withtrillium-compression, which
passes any response that already hasContent-Encodingthrough
unchanged. For non-default codings or suffixes, register variants
individually withwith_precompressed_variant(encoding, suffix).
Fixed
.without_etag_header()and.without_modified_header()now also apply
to direct-file requests, not just to index-file resolution.