Administering Mediator : Mediator : Mediator's GZIP Functionality : Mediator's Behavior in Various GZIP Scenarios
Mediator's Behavior in Various GZIP Scenarios
The table represents Mediator's behavior under various client and service configuration scenarios. These scenarios assume that the native service responds without any error.
Accept-Encoding Header Setting in Request
Content-Encoding Header Setting in Response
Original Content by Native Service
Mediator Behavior
gzip
not set
not encoded
Dynamically zips the response with Content-Encoding header set to gzip.
gzip,deflate compress;q=0.5, gzip;q=1.0
not set
not encoded
Dynamically zips the response with Content-Encoding header set to gzip.
* (any)
not set (or any encoding other than gzip)
not set (or any encoding other than gzip)
Passes the response to client (does not zip or unzip), with Content-Encoding set to the original content-encoding from the native service.
* (any)
gzip
encoded
Passes the zipped response to the client, with Content-Encoding set to gzip.
gzip
gzip
encoded
Passes the zipped response to client, with Content-Encoding set to gzip.
NULL (no encoding)
gzip
encoded
Unzips the content and removes the header, with Content-Encoding set to NULL.
NULL (no encoding)
null
not encoded
Passes the unzipped native service response to the client, with Content-Encoding set to NULL.
Mediator Response When Native Services Return Incorrect Content Encoding
In the scenarios mentioned in the Mediator's Behavior in Various GZIP Scenarios section, the native service responds with correct content encoding and correct content but if the native service fails to do that (for example, if it zips the response but does not set the Content-Encoding error, or vice-versa), an Exception occurs for the client and the error is logged. Such scenarios are represented in the following table:
Accept-Encoding Header Setting in Request
Content-Encoding Header Setting in Response
Original Content by Native Service
Mediator Response
gzip
not set
encoded
Exception occurs and errors are logged.
gzip
gzip
not encoded
Exception occurs and errors are logged.
gzip,deflate compress;q=0.5, gzip;q=1.0
gzip
not encoded
Exception occurs and errors are logged.
* (any)
gzip
not encoded
Exception occurs and errors are logged.
NULL
gzip
not encoded
Exception occurs and errors are logged.
Response To Policy Violations
If Mediator rejects the request due to a policy violation, then only a plain response reaches the client, regardless of the Accept-Encoding.
Accept-Encoding Header Setting in Request
Content-Encoding Header Setting in Response
Original Content in Native Service
Mediator Response
gzip or gzip,deflate compress;q=0.5, gzip;q=1.0
any
any
1. Mediator rejects the request from the client and not the response from the native service. In this case, the request does not go to the native service.
2. Mediator sends an uncompressed response to the client.
Response When Native Services Return SOAP Faults
If the native service returns a SOAP fault, then Mediator compresses or decompresses the response, based on the Accept-Encoding headers.
Accept-Encoding Header Setting in Request
Content-Encoding Header Setting in Response
Original Content in Native Service
Mediator Response
gzip or gzip,deflate compress;q=0.5, gzip;q=1.0
any
any
1. Mediator passes the request to the native service.
2. The server returns a SOAP fault.
3. Mediator compresses or uncompresses depending on the Accept-Encoding.
Behavior with Zipped Requests
Mediator also has the ability to process gzipped requests sent by the client:
*When the client sets the Content-Encoding:gzip and sends a zipped request to Mediator, then Mediator sends the zipped request to the native service with the Content-Encoding header unchanged.
*If the client sends to Mediator any Content-Encoding other then GZIP, then the header is removed and an uncompressed plain request is sent to the native service.
Copyright © 2015- 2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback