Use-As-Dictionary

The HTTP Use-As-Dictionary response header instructs the client to store the response body as a Compression dictionary for future requests matching the specified patterns.

Usage

Compression dictionaries reduce bandwidth by encoding repeated patterns against a shared reference. The Use-As-Dictionary header turns the current response into a dictionary the client stores locally. When the client later requests a URL matching the dictionary's match pattern, the client sends Available-Dictionary with the SHA-256 hash of the stored dictionary. The server then compresses the response against the dictionary using dictionary-compressed Brotli (dcb) or dictionary-compressed Zstandard (dcz) via Content-Encoding.

The header is a Structured Fields Dictionary. The match parameter is required and specifies a URLPattern string for request matching (wildcards like /api/* are supported, regular expressions are not). The match-dest parameter limits the dictionary to specific Fetch request destinations (document, script, style, fetch). The id parameter assigns an opaque identifier the client echoes back via Dictionary-ID. The type parameter declares the dictionary format as a token, with raw as the default and only defined value.

The response carrying Use-As-Dictionary must include standard Caching headers so the client stores the dictionary alongside the response. Dictionaries work best for resources with stable structure and repeated content across versions: JavaScript bundles, API responses, and template fragments. The specification requires compression dictionary transport to operate exclusively in secure contexts (HTTPS).

Directives

match

The match parameter is required and defines a URLPattern string determining which future requests use this dictionary. The pattern follows the WHATWG URLPattern standard and supports wildcards (e.g. /api/*), but regular expressions are not supported. The pattern must be same-origin as the dictionary resource.

match-dest

The match-dest parameter restricts the dictionary to specific Fetch request destination types. The value is an inner list of strings such as document, script, style, font, image, or fetch. When omitted or empty, the dictionary matches all destination types.

id

The id parameter assigns an opaque server-provided identifier to the dictionary (up to 1024 characters). The client echoes this value via the Dictionary-ID request header when using the dictionary. The server must not rely on id to guarantee dictionary contents.

type

The type parameter declares the dictionary format as a token. The only defined value is raw (the default), indicating an unformatted byte sequence usable as an external dictionary for Brotli or Zstandard. Clients reject unknown type values. The compression algorithm is negotiated separately through Accept-Encoding and Content-Encoding using the dcb (dictionary-compressed Brotli) or dcz (dictionary-compressed Zstandard) tokens.

Example

A server marks an API response as a compression dictionary for paths under /api/. The response includes Cache-Control so the client stores the dictionary.

HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: max-age=86400
Use-As-Dictionary: match="/api/*"

{
  "version": "2.1",
  "common_fields": [...]
}

On the next request to a matching path, the client sends the SHA-256 hash of the stored dictionary and advertises dictionary-compressed encodings.

GET /api/users HTTP/1.1
Host: example.re
Accept-Encoding: dcb, dcz
Available-Dictionary:
  :pZGm1Av0IEBKARczz7exkNYsZb8LzaMrV7J32a2fFG4=:

The server compresses the response against the dictionary and signals the encoding used.

HTTP/1.1 200 OK
Content-Encoding: dcz
Content-Type: application/json

A dictionary restricted to fetch destinations with an identifier for server-side tracking.

Use-As-Dictionary: match="/data/*", match-dest=("fetch"), id="data-v1"

A JavaScript bundle dictionary scoped to script destinations. The client reuses the dictionary across bundle version updates where the structure is stable.

Use-As-Dictionary: match="/assets/app-*", match-dest=("script")

Takeaway

The Use-As-Dictionary header marks the response as a Compression dictionary for future requests, defining match patterns, destination types, and dictionary format to enable bandwidth reduction through dictionary-compressed Brotli (dcb) or Zstandard (dcz).

See also

Last updated: March 11, 2026