Closed nickjacob closed 8 years ago
Thanks for the suggestion. It's something we'll need to add to the backlog, but will require a bit of work and testing of each adapter.
@nickjacob is it possible to change the AOL/OpenX adaptor, so that they don't load the SDK on each request? It's more efficient that way as well. It may not be possible with their code today, but we can make this as a requirement, so bidders upgrade their adaptors.
we could do something like AMP does internally, like:
loadService(window, 'http://adtech.us/script.js', function () {
window.ADTECH();
});
function loadService(_global, src, callback) {
// scripts are loaded by the global passed in, so we could
// load a script in an iframe if we wanted to
var _scriptLoad = _global._scriptLoad || (_global._scriptLoad = {});
if (!_scriptLoad[src]) {
_scriptLoad[src] = [];
// modify loadScript to take a window to load w/i
loadScript(src, function () {
function _call(f){ return f(_global) };
utils._each(_scriptLoad[src], _call);
_scriptLoad[src].push = _call;
}, _global);
}
_scriptLoad[src].push(callback);
}
I think this would be good in general but idk if it would solve for all refresh() scenarios
@nickjacob
I added caching to the adLoader.loadScript()
function, which probably would solve this problem I think?
https://github.com/prebid/Prebid.js/pull/242/files#diff-86d571de6e2be77b9e9aa02a2b847c41R11
Closing, reopen if new info.
Because some adapters load SDKs (AOL, OpenX) on
callBids()
, and different bidders have different requirements when requesting an additional pageview/auction, I was thinking it might be helpful to have an optionalrefresh(params)
method in the adapter interface, so we can help minimize the impact during infinite scroll/slideshows & have best possible integrations on subsequent pageviews. For example the adtech adapter might look like: