Hacker News new | ask | show | jobs
by cuddlecake 2544 days ago
Phoenix LiveView is basically server side rendering in real time.

The user's actions are sent to the Backend via WebSocket, and the Backend rerenders (parts of) the view and sends them to the user.

1 comments

But ... why? Sends it back as ... HTML?
Not really, the frontend caches the static parts of the template and the backend only needs to resend the dynamic, changing, parts.

So "Welcome to $mysite, $username." would initially send the full rendering but if the data changes it would only send "Hacker News,lawik" over the wire. Somewhat simplified.

This covers it quite well: https://www.youtube.com/watch?v=8xJzHq8ru0M