Setting the file. One moment.
Skill 07 · Clickhouse Js Node Troubleshooting
Subchapter 7.1
reference/compression.mdMarkdown1 KBView on GitHub
Applies to: all versions. Response compression was enabled by default in
< 1.0.0and disabled by default since>= 1.0.0— you must explicitly enable it. Request compression has always been opt-in.
Both request and response compression are supported. Only GZIP is supported (via zlib).
import { createClient } from "@clickhouse/client";
const client = createClient({
compression: {
response: true,
request: true,
},
});If you enable compression.response: true and get a ClickHouse settings error, you are likely connecting as a readonly=1 user. Response compression requires the enable_http_compression setting, which read-only users cannot change.
See reference/readonly-users.md for the fix.
< 1.0.0 and is disabled by default in >= 1.0.0, so on newer versions you must enable compression.response: true explicitly.enable_http_compression = 1 in server config). By default this is enabled on ClickHouse Cloud and most self-hosted setups.compression.request: true) compresses the request body sent to ClickHouse. It has no effect on the response.