---
title: "CompressResponseOptions"
source: "https://github.com/remix-run/remix/blob/8905f3943706e1f53696ab83e70a84873cabfc90/packages/response/src/lib/compress.ts#L25"
---

# CompressResponseOptions

## Summary

Configuration for negotiated response compression in [`compressResponse`](/response/compress/function/compressResponse/).

## Signature

```ts
interface CompressResponseOptions {
  brotli?: BrotliOptions
  encodings?: Encoding[]
  threshold?: number
  zlib?: ZlibOptions
}

```

## Properties

### `brotli`

node:zlib options for Brotli compression.

For HTML and SSE responses (`text/html` and `text/event-stream`),
`flush: BROTLI_OPERATION_FLUSH` is automatically applied unless you explicitly set a flush
value.

See: https://nodejs.org/api/zlib.html#class-brotlioptions

### `encodings`

Which encodings the server supports for negotiation in order of preference.
Supported encodings: 'br', 'gzip', 'deflate'.
Default: ['br', 'gzip', 'deflate']

### `threshold`

Minimum size in bytes to compress (only enforced if Content-Length is present).
If Content-Length is absent, compression is applied regardless of this threshold.

Default: 1024

### `zlib`

node:zlib options for gzip/deflate compression.

For HTML and SSE responses (`text/html` and `text/event-stream`),
`flush: Z_SYNC_FLUSH` is automatically applied unless you explicitly set a flush value.

See: https://nodejs.org/api/zlib.html#class-options