From 0263a5153f54653cd7fdec6b6ad71aef2ce3497a Mon Sep 17 00:00:00 2001 From: Jason Quaccia Date: Fri, 25 Apr 2025 13:49:31 -0700 Subject: [PATCH 1/5] docs for gzip support for bid requests --- .../publisher-api-reference/bidderSettings.md | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/dev-docs/publisher-api-reference/bidderSettings.md b/dev-docs/publisher-api-reference/bidderSettings.md index a39d866c98..fb072c18cb 100644 --- a/dev-docs/publisher-api-reference/bidderSettings.md +++ b/dev-docs/publisher-api-reference/bidderSettings.md @@ -48,6 +48,7 @@ Some sample scenarios where publishers may wish to alter the default settings: | allowAlternateBidderCodes | standard or adapter-specific | 6.23.0 | true in v6.x
false from v7.0| Allow adapters to bid with alternate bidder codes. | | allowedAlternateBidderCodes | standard or adapter-specific | 6.23.0 | n/a | Array of bidder codes for which an adapter can bid.
`undefined` or `['*']` will allow adapter to bid with any bidder code. | | adjustAlternateBids | standard or adapter-specific | 7.48.0 | false | Optionally allow alternate bidder codes to use an adapter's bidCpmAdjustment function by default instead of the standard bidCpmAdjustment function if present (note: if a bidCpmAdjustment function exists for the alternate bidder code within bidderSettings, then this will be used instead of falling back to the adapter's bidCpmAdjustment function). | +| endpointCompression | standard or adapter-specific | 9.42.0 | false | Compresses bid requests sent to bidder endpoints using gzip if browser supports it (`note: bidder endpoints must support gzip compressed bid requests`). | ##### 2.1. adserverTargeting @@ -344,4 +345,30 @@ pbjs.bidderSettings = { In the above example, if PubMatic were to return the "groupm" bidder code then the bidCpmAdjustment function under `pubmatic` would be used instead of what is available under `standard`. +##### 2.11. endpointCompression + +{: .alert.alert-warning :} +Note: The bidder's endpoint must already support receiving gzip compressed bid requests (otherwise this feature will not work and most likely throw an error with the bidder's endpoint). + +If this setting is enabled (`true`), Prebid.js will attempt to gzip-compress bid requests sent to bidder endpoints when possible. + +Compression is performed client-side using the browser's [CompressionStream](https://developer.mozilla.org/en-US/docs/Web/API/CompressionStream) API, if available. If CompressionStream is not supported by the user's browser, the bid request will be sent uncompressed. + +This setting can be enabled either: + +- globally for all bidders (under the `standard` section), or +- specifically for one or more bidders. + +The default value is `false`, meaning requests are not compressed unless explicitly configured by the publisher. + +**Example enabling endpoint compression for a specific bidder (PubMatic):** + +```javascript +pbjs.bidderSettings = { + pubmatic: { + endpointCompression: true + } +}; +``` +
From 8d7d6b7b355fd6c091b283e0e66fe4fc5897d940 Mon Sep 17 00:00:00 2001 From: Jason Quaccia Date: Fri, 25 Apr 2025 13:59:02 -0700 Subject: [PATCH 2/5] fixed linter error --- dev-docs/publisher-api-reference/bidderSettings.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev-docs/publisher-api-reference/bidderSettings.md b/dev-docs/publisher-api-reference/bidderSettings.md index fb072c18cb..b5441322ab 100644 --- a/dev-docs/publisher-api-reference/bidderSettings.md +++ b/dev-docs/publisher-api-reference/bidderSettings.md @@ -356,8 +356,8 @@ Compression is performed client-side using the browser's [CompressionStream](htt This setting can be enabled either: -- globally for all bidders (under the `standard` section), or -- specifically for one or more bidders. +* globally for all bidders (under the `standard` section), or +* specifically for one or more bidders. The default value is `false`, meaning requests are not compressed unless explicitly configured by the publisher. From c552e6df1b6bbc48b21f25f10a25a90364dede8d Mon Sep 17 00:00:00 2001 From: Jason Quaccia Date: Fri, 9 May 2025 15:06:03 -0700 Subject: [PATCH 3/5] updated docs for the pubmatic bid adapter supporting endpoint compression --- dev-docs/bidders/pubmatic.md | 6 +++++ .../publisher-api-reference/bidderSettings.md | 27 ------------------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/dev-docs/bidders/pubmatic.md b/dev-docs/bidders/pubmatic.md index 6f1ace23e7..8930831623 100644 --- a/dev-docs/bidders/pubmatic.md +++ b/dev-docs/bidders/pubmatic.md @@ -226,4 +226,10 @@ Publishers should use the `ortb2` method of setting [First Party Data](https://d - `ortb2.user.*` AdUnit-specific data is supported using `AdUnit.ortb2Imp.ext.*` + +### Endpoint Compression + +If the browser a Prebid auction is running in supports gzip compression, the PubMatic bid adapter will automatically compress all outgoing bid requests to the PubMatic server-side endpoint (which provides support for receiving gzip compressed requests). If gzip compression is not supported by the browser, bid requests will be sent uncompressed. + +Note: If the Prebid.js debugging query param, `?pbjs_debug=true`, is present in the URL, the feature will be disabled and all bid requests will be sent uncompressed. diff --git a/dev-docs/publisher-api-reference/bidderSettings.md b/dev-docs/publisher-api-reference/bidderSettings.md index b5441322ab..a39d866c98 100644 --- a/dev-docs/publisher-api-reference/bidderSettings.md +++ b/dev-docs/publisher-api-reference/bidderSettings.md @@ -48,7 +48,6 @@ Some sample scenarios where publishers may wish to alter the default settings: | allowAlternateBidderCodes | standard or adapter-specific | 6.23.0 | true in v6.x
false from v7.0| Allow adapters to bid with alternate bidder codes. | | allowedAlternateBidderCodes | standard or adapter-specific | 6.23.0 | n/a | Array of bidder codes for which an adapter can bid.
`undefined` or `['*']` will allow adapter to bid with any bidder code. | | adjustAlternateBids | standard or adapter-specific | 7.48.0 | false | Optionally allow alternate bidder codes to use an adapter's bidCpmAdjustment function by default instead of the standard bidCpmAdjustment function if present (note: if a bidCpmAdjustment function exists for the alternate bidder code within bidderSettings, then this will be used instead of falling back to the adapter's bidCpmAdjustment function). | -| endpointCompression | standard or adapter-specific | 9.42.0 | false | Compresses bid requests sent to bidder endpoints using gzip if browser supports it (`note: bidder endpoints must support gzip compressed bid requests`). | ##### 2.1. adserverTargeting @@ -345,30 +344,4 @@ pbjs.bidderSettings = { In the above example, if PubMatic were to return the "groupm" bidder code then the bidCpmAdjustment function under `pubmatic` would be used instead of what is available under `standard`. -##### 2.11. endpointCompression - -{: .alert.alert-warning :} -Note: The bidder's endpoint must already support receiving gzip compressed bid requests (otherwise this feature will not work and most likely throw an error with the bidder's endpoint). - -If this setting is enabled (`true`), Prebid.js will attempt to gzip-compress bid requests sent to bidder endpoints when possible. - -Compression is performed client-side using the browser's [CompressionStream](https://developer.mozilla.org/en-US/docs/Web/API/CompressionStream) API, if available. If CompressionStream is not supported by the user's browser, the bid request will be sent uncompressed. - -This setting can be enabled either: - -* globally for all bidders (under the `standard` section), or -* specifically for one or more bidders. - -The default value is `false`, meaning requests are not compressed unless explicitly configured by the publisher. - -**Example enabling endpoint compression for a specific bidder (PubMatic):** - -```javascript -pbjs.bidderSettings = { - pubmatic: { - endpointCompression: true - } -}; -``` -
From fb24eed632b197a97ac9c71e35102fc3a69c4ced Mon Sep 17 00:00:00 2001 From: Jason Quaccia Date: Wed, 21 May 2025 13:12:29 -0700 Subject: [PATCH 4/5] updated gzip compression docs --- dev-docs/bidder-adaptor.md | 14 ++++++++++++++ dev-docs/bidders/pubmatic.md | 4 +--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dev-docs/bidder-adaptor.md b/dev-docs/bidder-adaptor.md index bfa42399c3..0350dd0dd9 100644 --- a/dev-docs/bidder-adaptor.md +++ b/dev-docs/bidder-adaptor.md @@ -271,6 +271,20 @@ Building the request will use data from several places: * **BidRequest Params**: Several important parameters such as first-party data, userId, GDPR, USP, and supply chain values are on the `bidderRequest` object. * **Prebid Config**: Publishers can set a number of config values that bid adapters should consider reading. +#### Compression Support for Outgoing Requests + +Prebid.js core now includes support for gzip compression of bidder request payloads (This can help reduce payload size and improve performance). + +The following criteria must be met for a request to be compressed: + +* Browser supports gzip compression +* Participating bidders have enabled compression support within their bid adapter by updating their outgoing bidder requests to include `request.options.endpointCompression = true` +* Participating bidders have implemented compression support on their server-side endpoint + +If the above criteria is met, Prebid core will automatically compress outgoing data payloads. + +Note: If the Prebid.js debugging query param `?pbjs_debug=true` is present in the URL or `debug: true` has been configured in `pbjs.setConfig()`, the gzip compression feature will be disabled and all bidder requests will be sent uncompressed. + #### Ad Unit Params in the validBidRequests Array Here is a sample array entry for `validBidRequests[]`: diff --git a/dev-docs/bidders/pubmatic.md b/dev-docs/bidders/pubmatic.md index 8930831623..24b1e44080 100644 --- a/dev-docs/bidders/pubmatic.md +++ b/dev-docs/bidders/pubmatic.md @@ -229,7 +229,5 @@ AdUnit-specific data is supported using `AdUnit.ortb2Imp.ext.*` ### Endpoint Compression -If the browser a Prebid auction is running in supports gzip compression, the PubMatic bid adapter will automatically compress all outgoing bid requests to the PubMatic server-side endpoint (which provides support for receiving gzip compressed requests). If gzip compression is not supported by the browser, bid requests will be sent uncompressed. - -Note: If the Prebid.js debugging query param, `?pbjs_debug=true`, is present in the URL, the feature will be disabled and all bid requests will be sent uncompressed. +This adapter utilizes gzip compression support built into Prebid.js core. For more information, see [Compression Support for Outgoing Requests](https://docs.prebid.org/dev-docs/bidder-adaptor.html#compression-support-for-outgoing-requests) From 3e9277cdc58d768c98e48655e7fc671f3def420b Mon Sep 17 00:00:00 2001 From: Jason Quaccia Date: Wed, 21 May 2025 15:39:29 -0700 Subject: [PATCH 5/5] updated text for gzip docs --- dev-docs/bidder-adaptor.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dev-docs/bidder-adaptor.md b/dev-docs/bidder-adaptor.md index 0350dd0dd9..cce24c4cf6 100644 --- a/dev-docs/bidder-adaptor.md +++ b/dev-docs/bidder-adaptor.md @@ -273,15 +273,15 @@ Building the request will use data from several places: #### Compression Support for Outgoing Requests -Prebid.js core now includes support for gzip compression of bidder request payloads (This can help reduce payload size and improve performance). +Prebid.js core now includes support for gzip compression of bidder request payloads (This helps reduce payload size and improve performance). -The following criteria must be met for a request to be compressed: +Prebid will pass compressed payloads if the following criteria are met: -* Browser supports gzip compression -* Participating bidders have enabled compression support within their bid adapter by updating their outgoing bidder requests to include `request.options.endpointCompression = true` +* `request.options.endpointCompression = true` is set by a bidder with outgoing requests (An example of this can be viewed [here](https://github.com/prebid/Prebid.js/blob/master/modules/pubmaticBidAdapter.js#L730)) +* The browser supports gzip compression (Prebid core has a built-in utility function to check this) * Participating bidders have implemented compression support on their server-side endpoint -If the above criteria is met, Prebid core will automatically compress outgoing data payloads. +If the above criteria is met, the new Gzip compression can be utilized. Note: If the Prebid.js debugging query param `?pbjs_debug=true` is present in the URL or `debug: true` has been configured in `pbjs.setConfig()`, the gzip compression feature will be disabled and all bidder requests will be sent uncompressed.