What is the difference between Push API and Server Sent Events?

Rishul Matta picture Rishul Matta · Mar 29, 2015 · Viewed 9.1k times · Source

From the documentation I could figure out that Push API and Server Sent Events both are half duplex but why two different technologies for the same functionality? Is there something more significant in Push API?

Answer

Marco Castelluccio picture Marco Castelluccio · Feb 9, 2016

The Push API allows the server to send a notification to a client even when your site is not open, because it relies on service workers.

SSE (or WebSockets) work as long as the user is using your site.

There are some examples (with documentation) in the Web Push section of the ServiceWorker Cookbook that can help you understand this better.