You can configure an HTTPReply node to compress
the data in the HTTP response, by setting properties on the node. You can also configure an
integration server to enable the compression of response data on all HTTPReply nodes on the server, by using an
HTTPReplyWithCompression policy.
About this task
A default HTTPReplyWithCompression policy is provided, which you can use to set compression
properties for all
HTTPReply nodes on an integration server.
To enable the default properties in the policy, uncomment the
HTTPReply
property in the
server.conf.yaml configuration file, as shown in the following
example:
HTTPReply: 'HTTPReplyWithCompression'
Procedure
Configure compression on a specific HTTPReply
node by completing the following steps:
- In the IBM® App Connect
Enterprise Toolkit, select the HTTPReply node in the message flow to show the node properties in
the editor.
- On the Basic tab, set the Compression type property to specify the type of compression to be used for data in the
HTTP response, by selecting one of the following options:
- Compressible MIME types: Select this option to enable compression for the set of
compressible MIME types listed in the
server/json/mimetypes/mime_type_db.json
file.
You can also add or exclude MIME types to be compressed, by setting properties in the
server.conf.yaml file, as described in step 3.
- All MIME types: Select this option to enable compression for all MIME types.
- No compression: Select this option to turn off compression for all data in the HTTP
response.
- Optional: Configure the HTTP compression properties for the
integration server, by completing the following steps:
- Open the server.conf.yaml file for your integration server. You
can edit the file by using the built-in YAML editor that is provided in the IBM App Connect
Enterprise Toolkit, either by double-clicking the file in the Application
Development view or by right-clicking the file and selecting .
- Set the following properties in the server.conf.yaml file:
- Set the HTTPReply property to specify the name of the policy that will be
used to compress messages on all HTTPReply nodes. Messages
are compressed only if they have a compressible content type and are no smaller than the minimum
byte size (1024). For example:
HTTPReply: 'HTTPReplyWithCompression'
- Set the additionalCompressibleMimeTypes property to specify one or more
MIME types to be compressed in addition to the types listed in the
server/json/mimetypes/mime_type_db.json file. You can specify multiple MIME
types in a comma-separated list. For
example:
additionalCompressibleMimeTypes: 'application/msgflow+xml'
- Set the removeCompressibleMimeTypes property to exclude specified MIME
types from the list of MIME types that will be compressed. You can specify multiple types in a
comma-separated list. For example:
removeCompressibleMimeTypes: 'text/xml,text/plain'
- Save the changes and restart the integration server for the changes to take
effect.