Skip to content

Commit 5736e83

Browse files
mkendall07jsnellbaker
authored andcommitted
add bid ttl to cache call (#3163)
1 parent f466b8c commit 5736e83

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/videoCache.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ function toStorageRequest(bid) {
6262
const vastValue = bid.vastXml ? bid.vastXml : wrapURI(bid.vastUrl, bid.vastImpUrl);
6363
return {
6464
type: 'xml',
65-
value: vastValue
65+
value: vastValue,
66+
ttlseconds: Number(bid.ttl)
6667
};
6768
}
6869

test/spec/videoCache_spec.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ describe('The video cache', function () {
100100
</Wrapper>
101101
</Ad>
102102
</VAST>`;
103-
assertRequestMade({ vastUrl: 'my-mock-url.com' }, expectedValue)
103+
assertRequestMade({ vastUrl: 'my-mock-url.com', ttl: 25 }, expectedValue)
104104
});
105105

106106
it('should make the expected request when store() is called on an ad with a vastUrl and a vastImpUrl', function () {
@@ -114,12 +114,12 @@ describe('The video cache', function () {
114114
</Wrapper>
115115
</Ad>
116116
</VAST>`;
117-
assertRequestMade({ vastUrl: 'my-mock-url.com', vastImpUrl: 'imptracker.com' }, expectedValue)
117+
assertRequestMade({ vastUrl: 'my-mock-url.com', vastImpUrl: 'imptracker.com', ttl: 25 }, expectedValue)
118118
});
119119

120120
it('should make the expected request when store() is called on an ad with vastXml', function () {
121121
const vastXml = '<VAST version="3.0"></VAST>';
122-
assertRequestMade({ vastXml: vastXml }, vastXml);
122+
assertRequestMade({ vastXml: vastXml, ttl: 25 }, vastXml);
123123
});
124124

125125
function assertRequestMade(bid, expectedValue) {
@@ -134,6 +134,7 @@ describe('The video cache', function () {
134134
puts: [{
135135
type: 'xml',
136136
value: expectedValue,
137+
ttlseconds: 25
137138
}],
138139
});
139140
}

0 commit comments

Comments
 (0)