WICG / interventions

A place for browsers and web developers to collaborate on user agent interventions.
Other
177 stars 28 forks source link

[Intervention] Stop Loading in background after N mins #59

Closed spanicker closed 2 years ago

spanicker commented 6 years ago

Loading tasks and loading of resources will be stopped when a renderer has been in the background for over 5 minutes, on mobile (eventually followed by desktop). The motivation is to reduce major sources of background work to improve responsiveness of foreground user experience, as well as conserve data and battery.

This is similar to recent intervention for stopping timers in background after 5 mins: https://github.com/WICG/interventions/issues/34

Many sites do not stop loading activity, even after their app has been in background for over 5 minutes (grace time). Our telemetry indicates that a non-trivial amount of CPU is spent in background work, even after 5 mins -- and loading related work dominates this time. (We are adding more instrumentation for UMA data.)

\cc @ojanvafai

domenic commented 2 years ago

We're revisiting the interventions repo in an attempt to move everything to the appropriate issue trackers (in this case the one for the Fetch Standard). See https://github.com/WICG/interventions/pull/72.

My impression is that this is already allowed by Fetch; after all, Fetch does not mandate that your connection speed, and so if it happens to go to 0 for background tabs, that's totally within-spec.

If we think that this is worth calling out explicitly, e.g. because sites have come to start depending on this behavior, then we can open an issue on whatwg/fetch to basically change the parts that say "download bytes" to instead stop downloading bytes under certain conditions. But for now, we'll close this issue.