-
-
Save yogain123/d4a25abe7d0a6f52e5c26902d21a5eca to your computer and use it in GitHub Desktop.
hola |
SSR, Isomorphic JavaScript, Universal JavaScript
We can even do SSR without React, like using the handlebar, yeh Server Side templating/Rendering
SSR was not specific enough so we come up with IJ, UJ
Babel is also running in Server Side so we can also use New import way in Server as we do it in react
Authentication Issue
CSR:
SSR:
The problem above might be node server and API server might be in different domain or subdomain, so because of CORS request and Auth will not work
So...
Then why we are not using JWT??
if you want to use authentication in SSR app then it has to be cookie-based so the auth details could be included in the initial request made to your server
RenderToString vs RenderToNodeStream
RenderToString
RenderToNodeStream
Time to first byte (TTFB)
It is used by Google for indexing
But in case we use RenderToNodeSteam, but when it starts sending snipped of auth protected route, and then realize later it was not supposed to do that, then things will be problematic.
https://github.com/yogain123/React-SSR
Why SSR
CSR
The entire goal of SSR is to make content visible to user as fast as possible