Skip to content

Latest commit

 

History

History
67 lines (31 loc) · 3.3 KB

enable-and-configure-gzip-response-compression-390594a.md

File metadata and controls

67 lines (31 loc) · 3.3 KB

Enable and Configure Gzip Response Compression

Usage of gzip response compression can optimize the response time and improve interaction with an application as it reduces the traffic between the Web server and browsers. Enabling compression configures the server to return zipped content for the specified MIME type and size of the response.

Prerequisites

You have downloaded and configured SAP BTP console client.

For more information, see Set Up the Console Client.

Context

Remember:

SAP Business Technology Platform, Neo environment will sunset on December 31, 2028, subject to terms of customer or partner contracts.

For more information, see SAP Note 3351844.

Tip:

This documentation refers to SAP Business Technology Platform, Neo environment. If you are looking for documentation about other environments, see SAP Business Technology Platform ↗️.

You can enable and configure gzip using some optional parameters of the deploy command in the console client. When deploying the application, specify the following parameters:

Procedure

  1. To enable gzip compression, specify --compression on.

  2. To configure response MIME types that will be compressed, use --compressible-mime-type.

  3. To specify the size of responses which will be compressed, use --compression-min-size.

    If you enable compression but do not specify values for --compressible-mime-type or --compression-min-size, then the defaults are used: text/html, text/xml, text/plain and 2048 bytes, respectively.

    If you specify values for --compressible-mime-type or --compression-min-size but do not enable compression, then the operation passes, compression is not enabled and you get a warning message.

    If you want to enable compression for all responses independently from MIME type and size, use only --compression force.

Example

neo deploy myapp.properties --compression on --compressible-mime-type application/javascript,application/json
 --compression-min-size 1024

Next Steps

Once enabled, you can disable the compression by redeploying the application without the compression options or with parameter --compression off.

Related Information

Console Client for the Neo Environment

deploy