This Feature Request is to gauge WebKit's interest in implementing the ServiceWorkerRegistration's SyncManager interface (https://wicg.github.io/BackgroundSync/spec/#sync-manager-interface), aka. "Background Sync".
It's "live" in Chrome (https://www.chromestatus.com/feature/6170807885627392) and "in development" in Firefox (https://groups.google.com/forum/#!msg/mozilla.dev.platform/cTAnBeZFtUE/kx0I4UC-AQAJ).
Thomas, can you add any examples of real sites you know of leveraging this in the wild today? I.e. how will the user (or developer) experience be better on real sites if this is shipped? I believe that's the sort of information Apple needs in order to figure out how to prioritize requests like this.
(Sorry this took longer, I was traveling.)
I synced back (no pun intended) with a number of colleagues, and we crowdsourced three main themes where this technology is used in practice:
1) Updating in the Background:
Applications can use this technology to update information required by the app in the background. This currency converter PWA https://material.money/ is a great example. Another example is https://r.nikkei.com/ that uses Background Sync to update their offline caches.
2) Offline Analytics:
Background Sync can be used to replay failed requests, for example, to a Web analytics endpoint. See https://developers.google.com/web/tools/workbox/modules/workbox-google-analytics for a real-world integration with Google Analytics. Offline analytics is one of the highly demanded PWA features by both advertisers and publishers.
3) "Fire and forget":
Chat applications can use this to allow users to send messages that reliably eventually will be sent, no matter the current network connection. This demo https://jakearchibald-gcm.appspot.com/ shows this in action. Likewise, the technology can be used for queuing comments on blog posts etc., here is a demo: https://justmarkup.github.io/demos/form-enhancement/v7/.
Hope this helps Apple prioritize the feature request. Happy to add more detail upon request.
Adding a comment from Pinterest’s Engineering Manager Zack Argyle demonstrating the potential real world impact of implementing this feature request:
“We enabled service worker BackgroundSync for logging requests in Pinterest's mobile #pwa and are recovering ~370k requests/day. Each of those requests contains multiple logs. That's amazing! Going to ship that experiment today for sure.”—http://twitter.com/ZackArgyle/status/969049287408701441
+1 Would be great to have this
+1 It will be fantastic to have this.
The Google Search team have just documented why they need the Background Sync API: https://web.dev/google-search-sw/#meaningful-offline-experience.
Does Google Search use case require Background Sync to work even in a non-PWA/installed context? It was hard to tell from the post. Exposing it without an install action would be worrisome.
(In reply to Maciej Stachowiak from comment #8)
> Does Google Search use case require Background Sync to work even in a
> non-PWA/installed context? It was hard to tell from the post. Exposing it
> without an install action would be worrisome.
This is purely for the website, yes. Quoting from https://web.dev/google-search-sw/#non-goals: "Rather than trying to turn the Google Search web experience into the equivalent of what you'd expect from an installed application, the focus on the initial roll out was to progressively enhance the existing web site."