files/en-us/web/http/reference/headers/use-as-dictionary/index.md
{{SeeCompatTable}}
The HTTP Use-As-Dictionary response header lists the matching criteria that the {{glossary("Compression Dictionary Transport")}} dictionary can be used for, for future requests.
See the Compression Dictionary Transport guide for more information.
Use-As-Dictionary: match="<url-pattern>"
Use-As-Dictionary: match-dest=("<destination1>" "<destination2>", …)
Use-As-Dictionary: id="<string-identifier>"
Use-As-Dictionary: type="raw"
// Multiple, in any order
Content-Encoding: match="<url-pattern>", match-dest=("<destination1>")
match
false.match-dest
id
type
raw is supported (which is the default) so this is more for future compatibility.Use-As-Dictionary: match="/product/*"
This says the dictionary is only to be used for URLs starting with /product/.
Use-As-Dictionary: match="/app/*/main.js"
This uses a wildcard to match multiple versions of a file.
Use-As-Dictionary: match="/product/*", match-dest=("document")
This uses match-dest to ensure the dictionary is only used for document requests so <script src="/product/js/app.js"> resource requests for example would not match.
Use-As-Dictionary: match="/product/*", match-dest=("document" "frame")
This would allow the dictionary to match both top-level documents and iframes.
Use-As-Dictionary: match="/product/*", id="dictionary-12345"
When Use-As-Dictionary includes an id directive, as in this example, the id value will be included in the {{HTTPHeader("Dictionary-ID")}} request header for resources that can use this dictionary. The resource request will also include the SHA-256 hash of the dictionary surrounded by colons in the {{HTTPHeader("Available-Dictionary")}} header:
Accept-Encoding: gzip, br, zstd, dcb, dcz
Available-Dictionary: :pZGm1Av0IEBKARczz7exkNYsZb8LzaMrV7J32a2fFG4=:
Dictionary-ID: "dictionary-12345"
The server must still check the hash from the Available-Dictionary header — the Dictionary-ID is additional information for the server to identify the dictionary but does not replace the need for the Available-Dictionary header.
Use-As-Dictionary: match="/product/*", type="raw"
Currently, only raw is supported (which is the default) so this is more for future compatibility.
{{Specifications}}
{{Compat}}