mode_generic & dictionary sharing #466

Closed
opened 2026-01-29 20:44:22 +00:00 by claunia · 1 comment
Owner

Originally created by @AlexandrosEmvoliadis on GitHub (Jun 12, 2023).

Hey

When brotli.MODE_GENERIC is set to compression mode, in my understanding, there is no static dictionary involved in the encoding process.

How does the decompressor decodes the received information? Do they still share the same dictionary?

Originally created by @AlexandrosEmvoliadis on GitHub (Jun 12, 2023). Hey When brotli.MODE_GENERIC is set to compression mode, in my understanding, there is no static dictionary involved in the encoding process. How does the decompressor decodes the received information? Do they still share the same dictionary?
Author
Owner

@eustas commented on GitHub (Jun 20, 2023):

Encoder and decoder have same "static" dictionary (see RFC).
Compression mode affects subtle internal compression params. There are 3 modes in API:

  • GENERIC is default mode; if mode is not explicitly set, it is generic
  • TEXT should be better mode for UTF-8 plaintext; currently it is same as generic
  • FONT is a special mode for WOFF2 font payloads

Hopefully that answers your question.

@eustas commented on GitHub (Jun 20, 2023): Encoder and decoder have same "static" dictionary (see RFC). Compression mode affects subtle internal compression params. There are 3 modes in API: - `GENERIC` is default mode; if mode is not explicitly set, it is generic - `TEXT` *should* be better mode for UTF-8 plaintext; currently it is same as generic - `FONT` is a special mode for WOFF2 font payloads Hopefully that answers your question.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#466