Compression based on MIME-type

We can create an entry in the WebSEAL configuration file for each MIME-type or group of MIME-types for which data compression is needed.

The mime-type can specify one particular MIME type or can use wildcard characters to specify a class of MIME types. Each mime-type declaration is a separate entry in the [compress-mime-types] stanza. The wildcard character (*) is limited to entries of one collection of MIME types. For example, text/*. Any MIME-type not listed in the stanza is not compressed. Order is important. The first entry matching a returned document is used for that document.

The minimum_doc_size value specifies the policy on the size of documents that are compressed. This value is an integer. Valid values are shown in the following list.

Any negative number other than -1 generates an error message.

When WebSEAL receives a request from a browser, the server examines the content-length field in the HTTP header to determine the size of the incoming data. However, not all HTTP responses contain the content-length field. When the content-length field is not found, WebSEAL compresses the document unless the applicable MIME-type is configured to never be compressed. For example, minimum_doc_size of -1.

The compression_level is an optional setting that specifies the data compression level. Valid values are integers 1 - 9. The larger the integer, the greater the amount of compression that takes place. The greater the amount of compression, the greater the load that is placed on the CPU. The value of increased compression must be weighed against any performance impacts. When the compression_level is not specified, a default level of 1 is used.

The following example compresses all documents of a size greater than 1000 bytes:

The following set of entries:

,

Parent topic: HTTP data compression