Back to articles
Server-Sent Events (SSE)

Server-Sent Events (SSE)

via Dev.toAlpha

I have been rummaging through a lot of backend-related content lately, and half the time, I don't really understand what is being said, but hey, it's an opportunity to learn. I came across this post on X: // Detect dark theme var iframe = document.getElementById('tweet-2041107243077152836-580'); if (document.body.className.includes('dark-theme')) { iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=2041107243077152836&theme=dark" } From my little knowledge studying backend systems, two of the options were familiar, polling and websockets, but SSE was strange. Now, if I had to answer the question in an interview, my knowledge would already eliminate the right answer. Here's what I was thinking: The client needs to get updates without asking, so a connection needs to be opened. You can see where I'm leaning towards. But I recognise that websockets is a bi-directional communication channel, we only need one direction, otherwise we'll be wasting resources...right? Also, does th

Continue reading on Dev.to

Opens in a new tab

Read Full Article
2 views

Related Articles