3 ms·
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
by cuddlecake 7y 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.
- jacobush 7y agoBut ... why? Sends it back as ... HTML?
- lawik 7y agoNot 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 https://www.youtube.com/watch?v=8xJzHq8ru0M