3 ms·
> That doesn't seem much better than having the browser poll the web server on a periodic basis... It could indeed be much better for performance. It means the
by teraflop 3y ago
> That doesn't seem much better than having the browser poll the web server on a periodic basis...
It could indeed be much better for performance. It means the polling happens over a (presumably) low-latency, high-throughput local datacenter connection, and not over the end-user's internet connection over which you have no control.
But more importantly, SSE only defines the interface between the web browser and web server. Rather than polling a DB, you could just as well hook the web server up to a more sophisticated pubsub system (although PHP might not be the best choice for that). In that regard, SSE is no different from websockets; the main difference is that it's a simpler protocol to implement, and only works one-way.
- bkyan 3y agoAh, the part that was missing from my mental map was having the PHP instance act as a subscriber in a pubsub system. Thanks!