Use scheduler.postTask or analogue to assign tasks to background priority
A variety of events in the project are known background type priority, and we could use fetch keepalive, sendBeacon, or scheduler.postTask to label them as such to each browser type. Examples include #12387 and #10062 is related.
Any sort of analytics call or onTimeout or onError event triggering network traffic seems like a candidate for background processing.
Alternatively, we could take control of the timing even more explicitly and add delays or tie the events to some milestone.
"Post auction, nonrendering tasks have been identified as low priority. We can add the background indication to all of them."
committee feedback is that it is important that we could override this somwhow, that bidders or publishers could up the priority of things that were default background
@patmmccann do you ming if I would suggest to evaluate scheduler.yield as a method to implement this behaviour instead of postTask?
The main advantages of scheduler.yield is that it would ensure there will be "continuation", that means that after yielding it will resume from the same order scripts as it would have done normally.
This is the ideal behaviour in my opinion to avoid other scripts to fight contention and preserve the order, Google Publisher Tag is also using scheduler.yield within the Ad Iframe insertion logic.
More info here: https://developer.mozilla.org/en-US/docs/Web/API/Scheduler/yield
Post auction, nonrendering tasks have been identified as low priority. We can add the background indication to all of them.