background-sync
background-sync copied to clipboard
Periodic sync: Ignore minimum intervals when the user is on the site?
Imagine a sync is registered, and due according to its minInterval, but delayed by 2 hours due to either "minimum periodic sync interval for any origin" (+ engagement) or "minimum periodic sync interval across origins".
However, there are pages/iframe open to the sync's origin. At this point, the site can run JS, and make fetches.
It seems better to do the sync now, when there's no privacy impact, and less significant battery impact, than wait 2 hours.
cc @mugdhalakhani @beverloo.
The site can do any synchronization outside of the 'periodicsync' event when it has pages/iframes open. Periodic Background Sync aims to facilitate synchronization when the user isn't on the site but has connectivity.
Then maybe https://github.com/WICG/BackgroundSync/issues/164 is the solution instead.
Capturing here what we discussed offline. A future version of PBS will likely set a morning and an evening time interval for synchronization, which will make this a non-issue.
Resource usage is less of concern with "minimum periodic sync interval across origins" set appropriately.