> For the complete documentation index, see [llms.txt](https://clients.medianova.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://clients.medianova.com/products/performance-cdn/static-content-delivery/advanced-configuration/compression.md).

# Compression

Understand how Medianova CDN applies Gzip and Brotli compression, including supported content types, compression requirements, origin behavior, and cached compressed responses.

**Compression** reduces the size of eligible HTTP response bodies before delivery to clients. Medianova CDN supports [**Gzip** and **Brotli**](https://clients.medianova.com/products/performance-cdn/static-content-delivery/advanced-configuration/compression/how-to-configure-gzip-and-brotli.md) compression and selects the appropriate encoding based on client capabilities and CDN Resource configuration.

When both methods are enabled and supported by the client, Brotli takes precedence.

<figure><img src="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2Fgit-blob-e889fb0284d2b20003f3456aa9378efd294fa45c%2Fmedianova-content-compression-diagram-bg-white.png?alt=media" alt="Diagram illustrating HTTP response compression through Medianova CDN"><figcaption><p>HTTP response compression through Medianova CDN.</p></figcaption></figure>

## Compression at the Edge

Medianova determines whether to deliver a response using Brotli, Gzip, or no compression based on:

* The client's `Accept-Encoding` request header.
* The compression methods enabled for the CDN Resource.
* The configured eligible content types.
* The response size.

### Compression Processing

Gzip and Brotli use different processing locations within the Medianova CDN architecture.

<table><thead><tr><th width="184.5">Compression Method</th><th>Processing Behavior</th></tr></thead><tbody><tr><td><strong>Gzip</strong></td><td>Compression is performed at Midcache servers. Compressed responses can be cached and subsequently delivered through Edge servers.</td></tr><tr><td><strong>Brotli</strong></td><td>Compression is performed dynamically at Edge servers when supported by the client.</td></tr></tbody></table>

Both methods can be enabled simultaneously.

### Compression Selection

Clients indicate supported compression formats through the `Accept-Encoding` request header.

For example:

```http
Accept-Encoding: br, gzip
```

This request header indicates that the client supports Brotli (`br`) and Gzip (`gzip`).

The CDN selects the response encoding according to the following behavior:

| Enabled Methods | Client Support    | Compression Behavior                           |
| --------------- | ----------------- | ---------------------------------------------- |
| Brotli and Gzip | Brotli and Gzip   | Brotli is prioritized.                         |
| Brotli and Gzip | Gzip only         | Gzip can be used.                              |
| Brotli and Gzip | Brotli only       | Brotli can be used.                            |
| Brotli only     | Brotli            | Brotli can be used.                            |
| Gzip only       | Gzip              | Gzip can be used.                              |
| Either or both  | Neither supported | The response is delivered without compression. |

Compression is applied only when the response meets the applicable content type and size requirements.

When compression is applied, the `Content-Encoding` response header identifies the encoding used.

For Brotli:

```http
Content-Encoding: br
```

For Gzip:

```http
Content-Encoding: gzip
```

## Supported Content Types

Medianova allows eligible MIME types to be configured independently for Gzip and Brotli compression.

The `text/html` content type is always included in compression eligibility.

By default, the following content types are configured:

```
application/atom+xml
application/dash+xml
application/javascript
application/json
application/octet-stream
application/rdf+xml
application/rss+xml
application/vnd.ms-fontobject
application/x-font
application/x-font-opentype
application/x-font-otf
application/x-font-truetype
application/x-font-ttf
application/x-javascript
application/x-mpegURL
application/xhtml+xml
application/xml
application/x-www-form-urlencoded
font/opentype
font/otf
font/ttf
font/woff
font/woff2
image/svg+xml
image/x-icon
text/css
text/html
text/javascript
text/plain
text/x-component
text/xml
```

You can modify the configured content types for each compression method through the [Medianova Control Panel](https://cloud.medianova.com).

{% hint style="info" %}
Compression is generally most effective for text-based content. Some formats, including compressed images and font files, may provide limited additional size reduction.

Content type eligibility does not guarantee that every response will be compressed.
{% endhint %}

## Compression Requirements and Response Behavior

### Minimum Response Size

Compression is applied only when an eligible response body is at least **400 bytes**.

Responses smaller than this threshold are delivered without compression.

### HTTP Status Codes

Medianova can compress eligible responses received from the origin or served from CDN cache regardless of their HTTP status code.

However, some CDN features, such as Geo Blocking, generate lightweight error responses directly at the edge.

These edge-generated error responses are delivered without compression.

### Content-Length Header

Medianova delivers compressed responses without the `Content-Length` header.

This prevents an incorrect length value from being sent when the response body has been dynamically transformed through compression.

### Cache-Control: no-transform

The origin response directive `no-transform` does not disable compression within Medianova CDN.

For example:

```http
Cache-Control: no-transform
```

Medianova continues to apply compression according to the CDN Resource configuration, even when this directive is present.

{% hint style="info" %}
The behavior described here is specific to Medianova CDN. The HTTP `no-transform` directive normally instructs intermediaries not to modify the response representation.
{% endhint %}

## Compression at the Origin

Medianova requests uncompressed content from the origin server.

The CDN does not send an `Accept-Encoding` request header to the origin and expects responses without a `Content-Encoding` header.

Compression is subsequently applied within the CDN according to the enabled methods and configured content types.

{% hint style="info" %}
The origin should return uncompressed content for CDN-side compression processing. If the origin sends an already compressed response, the compression behavior described on this page may not apply.
{% endhint %}

## Compression Levels

Medianova uses the following compression levels:

| Encoding   | Compression Level |
| ---------- | ----------------: |
| **Gzip**   |                 6 |
| **Brotli** |                 5 |

These settings balance response size reduction with compression processing requirements.

## Cached Gzip Responses

Gzip-compressed responses can be stored in the CDN cache.

Disabling Gzip Compression does not automatically invalidate objects that were previously cached in compressed form.

Existing cached Gzip responses may remain available until:

* Their cache duration expires.
* They are purged from the CDN cache.

After a cached object is removed, subsequent responses follow the current compression configuration.

For information about removing cached objects, see Purge.

## Zstandard Support

Medianova CDN does not currently support Zstandard (`zstd`) compression.

## Important Notes

* Gzip and Brotli can be enabled independently or simultaneously.
* Brotli takes precedence when both methods are enabled and supported by the client.
* Gzip compression is performed at Midcache servers, while Brotli compression is performed dynamically at Edge servers.
* Compression eligibility depends on the configured MIME types and the minimum response size.
* Compression settings do not immediately invalidate previously cached Gzip responses.
* Origin responses should be uncompressed for the documented CDN-side compression behavior.

## Related Concepts

* [How to Configure Gzip and Brotli](https://clients.medianova.com/products/performance-cdn/static-content-delivery/advanced-configuration/compression/how-to-configure-gzip-and-brotli.md)
* [Purge](https://clients.medianova.com/products/performance-cdn/static-content-delivery/advanced-configuration/purge.md)
* [Caching](https://clients.medianova.com/products/performance-cdn/static-content-delivery/advanced-configuration/caching.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://clients.medianova.com/products/performance-cdn/static-content-delivery/advanced-configuration/compression.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
