diff --git a/src/videoCache.js b/src/videoCache.js index cec2a3ec864..bc70397fc94 100644 --- a/src/videoCache.js +++ b/src/videoCache.js @@ -62,7 +62,8 @@ function toStorageRequest(bid) { const vastValue = bid.vastXml ? bid.vastXml : wrapURI(bid.vastUrl, bid.vastImpUrl); return { type: 'xml', - value: vastValue + value: vastValue, + ttlseconds: Number(bid.ttl) }; } diff --git a/test/spec/videoCache_spec.js b/test/spec/videoCache_spec.js index c9052fbbf9d..b9c2d445646 100644 --- a/test/spec/videoCache_spec.js +++ b/test/spec/videoCache_spec.js @@ -100,7 +100,7 @@ describe('The video cache', function () { `; - assertRequestMade({ vastUrl: 'my-mock-url.com' }, expectedValue) + assertRequestMade({ vastUrl: 'my-mock-url.com', ttl: 25 }, expectedValue) }); 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 () { `; - assertRequestMade({ vastUrl: 'my-mock-url.com', vastImpUrl: 'imptracker.com' }, expectedValue) + assertRequestMade({ vastUrl: 'my-mock-url.com', vastImpUrl: 'imptracker.com', ttl: 25 }, expectedValue) }); it('should make the expected request when store() is called on an ad with vastXml', function () { const vastXml = ''; - assertRequestMade({ vastXml: vastXml }, vastXml); + assertRequestMade({ vastXml: vastXml, ttl: 25 }, vastXml); }); function assertRequestMade(bid, expectedValue) { @@ -134,6 +134,7 @@ describe('The video cache', function () { puts: [{ type: 'xml', value: expectedValue, + ttlseconds: 25 }], }); }