Data Compression (gzip)ΒΆ

BidSwitch supports JSON and Compressed JSON (gzip) as data formats for bid requests and bid responses. It is recommended to use Compressed JSON to minimize the amount of data exchanged between you and BidSwitch as this reduces latency times between servers, and traffic listening costs for all parties involved. Here is what BidSwitch has observed with gzip traffic:

  • When enabled, gzip compression ratios tend to be in the range of x1.4 to x2.0 (depending on the size of the request/response)

  • There is no tangible extra CPU load due to compressing/decompressing traffic, i.e. there is no extra cost

You can enable this on your integration at anytime as no changes are needed on the BidSwitch side.

In order to set up Compressed JSON bid requests and and accept compressed responses, use the following instructions:

  1. Compress your HTTP request body with gzip

  2. Add a Content-Encoding: gzip HTTP header to indicate that the request is compressed

  3. Add an Accept-Encoding: gzip header to indicate that you can accept a compressed response

  4. Please contact BidSwitch support at support@bidswitch.com to ensure all parties are aware of a change in the integration

Once set up, BidSwitch starts accepting bid requests in Compressed JSON and responds using compressed JSON. All such bid responses carry a Content-Encoding: gzip HTTP header indicating that the response is compressed. It is recommended that you check for this HTTP header to distinguish between JSON and Compressed JSON bid response formats, if it is present decompress the HTTP body before further processing.

Note

BidSwitch may still respond with non-compressed content when it detects that the size of a gzip compressed response would exceed the size of an uncompressed response. This may happen for very short bid responses. In this case the Content-Encoding: gzip header is absent.