ReactJS server-side rendering vs client-side rendering

前端 未结 4 536
执笔经年
执笔经年 2020-12-07 08:14

I just have began to study ReactJS and found that it gives you 2 ways to render pages: server-side and client-side. But, I can\'t understand how to use it together. Is it 2

4条回答
  •  生来不讨喜
    2020-12-07 08:25

    Image source: Walmart Labs Engineering Blog

    NB: SSR (Server Side Rendering), CSR (Client Side Rendering).

    The main difference being that with SSR, the servers response to the clients browser, includes the HTML of the page to be rendered. It is also important to note that although, with SSR, the page renders quicker. The page will not be ready for user interaction until JS files have been downloaded and the browser has executed React.

    One downside is that the SSR TTFB (Time to First Byte) can be slightly longer. Understandably so, because the server takes some time creating the HTML document, which in turn increases the servers response size.

提交回复
热议问题