Skip to content

Commit

Permalink
Prebid 1.0 server cache (#1935)
Browse files Browse the repository at this point in the history
* add cache stuff to video for prebid server

* add description for cacheMarkup
  • Loading branch information
snapwich authored Dec 6, 2017
1 parent ae8decc commit 5445b7c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/prebidServerBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ config.setDefaults({
* @property {string} endpoint endpoint to contact
* === optional params below ===
* @property {number} [timeout] timeout for S2S bidders - should be lower than `pbjs.requestBids({timeout})`
* @property {boolean} [cacheMarkup] whether to cache the adm result
* @property {string} [adapter] adapter code to use for S2S
* @property {string} [syncEndpoint] endpoint URL for syncing cookies
* @property {string} [cookieSetUrl] url for cookie set library, if passed then cookieSet is enabled
Expand Down Expand Up @@ -210,6 +211,7 @@ export function PrebidServer() {
max_bids: _s2sConfig.maxBids,
timeout_millis: _s2sConfig.timeout,
secure: _s2sConfig.secure,
cache_markup: _s2sConfig.cacheMarkup,
url: utils.getTopWindowUrl(),
prebid_version: '$prebid.version$',
ad_units: adUnits.filter(hasSizes),
Expand Down Expand Up @@ -272,6 +274,12 @@ export function PrebidServer() {
bidObject.creative_id = bidObj.creative_id;
bidObject.bidderCode = bidObj.bidder;
bidObject.cpm = cpm;
if (bidObj.cache_id) {
bidObject.cache_id = bidObj.cache_id;
}
if (bidObj.cache_url) {
bidObject.cache_url = bidObj.cache_url;
}
// From ORTB see section 4.2.3: adm Optional means of conveying ad markup in case the bid wins; supersedes the win notice if markup is included in both.
if (bidObj.media_type === VIDEO) {
bidObject.mediaType = VIDEO;
Expand Down

0 comments on commit 5445b7c

Please sign in to comment.