Introduction
dcz is a content coding for HTTP: Zstandard compression
that uses a dictionary the client already holds, so a new version of a resource is sent as little more than
what changed. It is defined in RFC 9842, “Compression Dictionary Transport”, with its Brotli counterpart
dcb. A saved response body is a .dcz file: a
fixed header, then a Zstandard stream.
It is a format of its own, not a Zstandard file with another name. The header is a skippable frame, so a
Zstandard tool skips it, but the stream after it was made with a dictionary the file does not contain and
cannot be decoded without it. The dictionary’s hash is the only link, and the viewer for it is the
Zstandard viewer extended to find the dictionary by that hash. A Zstandard file that happens to begin with
a 32-byte skippable frame with the same magic looks exactly the same; only its use tells them apart, so the
explorer reads a file named .zst, .zstd or .tzst as plain
Zstandard and one named .dcz (or with another name) as this.
Structure
0Magic number5E 2A 4D 18, a Zstandard skippable-frame magic (0x184D2A5E, little-endian), then the frame size20 00 00 00(32)8 bytes8SHA-256 hash of the dictionary the stream was made with, the frame’s content32 bytes40Zstandard stream compressed with the dictionary as a raw dictionarythe rest
The dictionary is a raw one (RFC 9842 defines no other type): its bytes are treated as a raw
dictionary under section 5 of the Zstandard RFC, content that matches may reach back into, with none of the
entropy tables a trained Zstandard dictionary carries. With Zstandard the dictionary is available only until
the input exceeds the window. A client that announces dcz must decompress windows of at least
8 MB or 1.25 times the dictionary size, whichever is larger, up to 128 MB. The frame and block layout of the
stream is on the Zstandard frame and
compressed block pages; the header and the HTTP side are on the
DCB and DCZ reference page.
In the explorer
Drop a .dcz file. The tree shows the header as a skippable frame holding the hash, then the
Zstandard frames and blocks as for any Zstandard file. To read the data, give the dictionary with it: drop
both files at once (or a folder holding both). The explorer hashes the files beside the .dcz file
with SHA-256 and uses the one whose digest is the header’s hash as the raw dictionary; the view says which file
it was. Without it, the frames are read until the first block that reaches back further than the data
decoded so far (which can only be into the dictionary); the bytes before that block are decoded and
exact, and the view says where it stopped. The sequences of a block are not listed one by one for Zstandard,
so unlike dcb the references into the missing dictionary are not listed.
Not described
Read against RFC 9842 in November 2026; the explorer was checked against the zstd
command-line tool, which compresses with a raw dictionary (-D).
Known, not yet covered
- Viewer: the references into a missing dictionary are not listed for the Zstandard stream (the Brotli viewer lists them); decoding stops at the first block that needs it.
- Viewer: a dictionary larger than 128 MB is not read from the files given with the header.
- Reference: the HTTP side (
Use-As-Dictionary,Available-Dictionary, matching and caching) is summarised on the DCB and DCZ page but not set out rule by rule.
Links
Software
- zstd – the command-line tool;
-Dcompresses against a raw dictionary, which gives the stream inside a dcz file (macOS, Linux, Windows) - Web browsers – ask for
dczinAccept-Encodingwhen they hold a matching dictionary (Chromium-based browsers)