# Compression

Wisej.NET provides built-in compression support for all `HTTP` and `WebSocket` communications.

## Enabling Compression

Compression is enabled by default. Both browser and Wisej.NET server use `gzip` as the default compression system.

Wisej.NET automatically compresses all `HTTP` and `WebSocket` packets when the size exceeds a certain threshold, ensuring that compression doesn't result in larger packets.

You may disable `WebSocket` compression by setting the `enableWebSocketCompression` setting to `false` in `Default.json`.

Disabling `WebSocket` compression allows you to debug the frames when examining Network packets using the browser's Developer Tools.

```javascript
{
  "enableWebSocketCompression": false
}
```

## Brotli

Wisej.NET fully supports the [`Brotli`](https://en.wikipedia.org/wiki/Brotli) compression library - even on browsers without native `Brotli` support.

Use Add New Item and select Brotli to add the `Wisej.Web.Ext.Brotli` assembly. The source code for this extension is available in our Github repository: [Brotli extension source code](https://github.com/iceteagroup/wisej-extensions/tree/2.0/Wisej.Web.Ext.Brotli).

{% hint style="danger" %}
Under some still unknown circumstances, the `Brotli` implementation from Google may generate the error "Unused space" on the browser. If you encounter this error, simply remove `Wisej.Web.Ext.Brotli.dll`.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/docs/concepts/compression.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
