DEV Community

Discussion on: Understanding Server Side Rendering

Collapse
 
mohammedfoysal profile image
Mohammed Foysal

Is there a way to have a SSR SPA hybrid? So on the first request, it acquires a server rendered page and then all clicks after that work with a SPA which makes RESTful calls?

Thread Thread
 
reegodev profile image
Matteo Rigon

Nuxt and Next already do this. You only reach the server on the first request and then everything else works like a spa

Thread Thread
 
devhammed profile image
Hammed Oyedele

Same with Gatsby.

Thread Thread
 
beenotung profile image
Beeno Tung

If you want to go futher, checkout LiveView, it returns complete layout in html/css on the initial get request, then use websocket to push user interaction to the server.
The server maintain the virtual dom, and send the diff patch to the client for partial update.

This way the client don't need to download heavy javascript bundles. It has two implementations so far, in typescript and elixir