Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prebid 1.0 server cache #1935

Merged
merged 2 commits into from
Dec 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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