Compresses what the routes answer in JSON, and the HTML page, for the browsers that accept it: a page of the feed is some twenty kilobytes as it is, and a fifth of that compressed. main.ts installs it after the error middleware, around everything that sets a body. The built frontend's files aren't its concern: lib/static.ts sends the copies compressed at build time.

Functions

f
compressMiddleware(
ctx: Context,
next: Next
): Promise<void>

Sends the response's JSON or text compressed, in brotli or gzip as the request accepts, when it is at least MIN_BYTES long. A response already encoded, a HEAD, and one marked no-transform go out as they are.