Skip to content

trillium-static-v0.6.0

Choose a tag to compare

@github-actions github-actions released this 21 May 23:22
· 81 commits to main since this release

Added

  • HTTP Range request support. Every response advertises Accept-Ranges: bytes. When a client sends a single-range Range: bytes=... header
    (START-END, START-, or -SUFFIX), the handler seeks into the file
    and streams just that byte range with status 206 Partial Content,
    Content-Range, and Content-Length. Out-of-bounds ranges return 416 Requested Range Not Satisfiable with Content-Range: bytes */N.
    Multi-range requests fall through to a 200 full body. Honors
    If-Range (strong-comparison only per RFC 9110); the metadata-derived
    etag is weak and so will not satisfy If-Range, but the
    Last-Modified date 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>.gz siblings when the
    client's Accept-Encoding allows them, in that priority order, with
    Content-Encoding set and the original asset's MIME type preserved.
    Vary: Accept-Encoding is 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 with trillium-compression, which
    passes any response that already has Content-Encoding through
    unchanged. For non-default codings or suffixes, register variants
    individually with with_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.