# _dictionary_endpoint

URL: /pounce/api/_dictionary_endpoint/
Section: api
Description: Built-in dictionary serving endpoint for RFC 9842 compression dictionaries.

Serves dictionary files at ``/.well-known/compression-dictionary/<hash>``
so clients can download dictionaries advertised via ``Use-As-Dictionary``.

Also provides ``use_as_dictionary_headers`` for injecting the
``Use-As-Dictionary`` response header on matching paths, enabling
browser dictionary discovery.

---

> For a complete page index, fetch /pounce/llms.txt.

Open LLM text
(/pounce/api/_dictionary_endpoint/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2F_dictionary_endpoint%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2F_dictionary_endpoint%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2F_dictionary_endpoint%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2F_dictionary_endpoint%2Findex.txt)

Module

#
`_dictionary_endpoint`

Built-in dictionary serving endpoint for RFC 9842 compression dictionaries.

Serves dictionary files at`/.well-known/compression-dictionary/<hash>`
so clients can download dictionaries advertised via`Use-As-Dictionary`.

Also provides`use_as_dictionary_headers`for injecting the
`Use-As-Dictionary`response header on matching paths, enabling
browser dictionary discovery.

2Functions

## Functions

`build_dictionary_response`

2

`tuple[int, list[tuple[by…`

▼

Build a response serving a dictionary file by its sf-hash.

`def build_dictionary_response(dictionaries: tuple[CompressionDictionary, ...], path: str) -> tuple[int, list[tuple[bytes, bytes]], bytes] | None`

##### Parameters

Name
Type
Description

`dictionaries`
`tuple[CompressionDictionary (/pounce/api/_compression/#CompressionDictionary), ...]`

Loaded server dictionaries.

`path`
`str`

Request path (e.g.`/.well-known/compression-dictionary/:abc=:`).

##### Returns

`tuple[int, list[tuple[bytes, bytes]], bytes] | None`

`use_as_dictionary_headers`

2

`list[tuple[bytes, bytes]]`

▼

Return ``Use-As-Dictionary`` headers for matching dictionaries.

For each dicti…

`def use_as_dictionary_headers(dictionaries: tuple[CompressionDictionary, ...], request_target: str) -> list[tuple[bytes, bytes]]`

Return`Use-As-Dictionary`headers for matching dictionaries.

For each dictionary whose `match` (/pounce/api/_compression/#CompressionDictionary) pattern covers the request target,
returns a header telling the browser to fetch and cache the dictionary
for future requests to matching URLs.

##### Parameters

Name
Type
Description

`dictionaries`
`tuple[CompressionDictionary (/pounce/api/_compression/#CompressionDictionary), ...]`

Loaded server dictionaries.

`request_target`
`str`

The request URL path.

##### Returns

`list[tuple[bytes, bytes]]`
