Skip to content

Latest commit

 

History

History
131 lines (80 loc) · 1.85 KB

compression-ff906e7.md

File metadata and controls

131 lines (80 loc) · 1.85 KB

compression

The compression keyword enables you to define if the application router compresses text resources before sending them.

By default, resources larger than 1KB are compressed. If you need to change the compression size threshold, for example, to “2048 bytes”, you can add the optional property “minSize”: <size_in_KB>, as illustrated in the following example.

Sample Code:

{
  "compression": {
      "minSize": 2048
  }
}

You can disable compression in the following ways:

  • Global

    Within the compression section add "enabled": false

  • Front end

    The client sends a header “Accept-Encoding” which does not include “gzip”.

  • Back end

    The application sends a header “Cache-Control” with the “no-transform” directive.

Application Router: Compression Properties

Property

Type

Mandatory

Description

minSize

Number

No

Text resources larger than this size will be compressed.

enabled

Boolean

No

Globally disables or enables compression. The default value is true.

compressResponseMixedTypeContent

Boolean

No

Determines whether response content of the multipart / mixed content type should be compressed. The default value is false.

Note:

If the <COMPRESSION> environment variable is set it will overwrite any existing values.