3 ms·
I assume every service worker is constantly polling a server back-end, or, at least, has a long-running connection? There are hundreds of service workers insta
by cbeach 4y ago
I assume every service worker is constantly polling a server back-end, or, at least, has a long-running connection?
There are hundreds of service workers installed for me in Chrome (see: chrome://serviceworker-internals/)
I recall on iOS, Apple's infrastructure aggregates push notifications on the server-side, meaning an iPhone only has to maintain a connection to a single server for all push notifications.
Are there any similar initiatives for the Push API? Or is it simply not a priority, given the looser bandwidth/CPU constraints on desktop computers?
- gsnedders 4y agoThis isn't how it works at all; a server sends a message to a push service which then delivers it to the user agent. It is only once the user agent receives the message that it needs to start an installed service worker (if it isn't already running) to deliver the message in the form of the notification. (There's some interest in making it possible to send a notification directly via the push service without having the cost of starting a service worker, but that's future work.) In the Safari case, this push service is essentially the same as is used for native apps, and it will do the same aggregation as you see for other notification types.