<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rax on Medium]]></title>
        <description><![CDATA[Stories by Rax on Medium]]></description>
        <link>https://medium.com/@raxjs?source=rss-886e062bd265------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*q8z5vdrTrgaPOWeLfTQnGg.png</url>
            <title>Stories by Rax on Medium</title>
            <link>https://medium.com/@raxjs?source=rss-886e062bd265------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 13 Apr 2026 21:01:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@raxjs/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Speed up Web App with SSR and Serverless]]></title>
            <link>https://medium.com/@raxjs/speed-up-web-app-with-ssr-and-serverless-1eddfb491f4e?source=rss-886e062bd265------2</link>
            <guid isPermaLink="false">https://medium.com/p/1eddfb491f4e</guid>
            <category><![CDATA[rax]]></category>
            <category><![CDATA[ssrs]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Rax]]></dc:creator>
            <pubDate>Wed, 05 Feb 2020 05:27:02 GMT</pubDate>
            <atom:updated>2020-02-05T05:27:02.969Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, with the completion of Rax SSR’s 6x React rendering performance improvement and the support of Serverless releases, we think it’s time to introduce Rax SSR to everyone.</p><h3>What is SSR</h3><p>The full name of SSR is Server-Side Rendering. As the name implies, the rendering is executed is on the server side.</p><p>Another common rendering way is CSR (Client Side Rendering), which renders pages directly in the browser using JavaScript. In CSR, it usually needs to do the rendering work after loading JS and fetching data.</p><p>The following picture shows the different loading sequence between CSR an SSR, when rendering the same application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/0*MWciLCjut2u-wRoX.png" /></figure><p>In CSR, the screenshot of orange corresponds to the time user have to wait before the meaningful contant reach.（The background color of the page is orange）</p><p>It can be seen that in terms of content arrival time, the working principle of SSR determines its advantages. This difference will be more obvious in a weak network environment.</p><h3>SSR’s Dilemma</h3><p>Although SSR outperforms CSR in FCP (First Contentful Paint), but why hasn’t it become the main rendering mode of the Web Application? We think this is because building a SSR application is not easy:</p><ul><li>When you start developing an SSR application, you are no longer a simple front-end development engineer, but will be forced to become a full-stack engineer. The delivery product has changed from the JS Bundle to a Node application. With it, it is necessary to select a Node framework, build a Node application, and deal with performance overhead, guarantee application stability, and so on.</li><li>Secondly, we also need to consider how to make the existing code run on the server side. Although most JS frameworks like React provide Server-Side Rendering capabilities, differences in rendering environment will cause many coding differences, such as calling the window variable on the Node side, will result in an error. The asynchronous function such as hooks can neither work on the Server-Side Rendering.</li><li>Finally, when you complete application development, you need to consider these issues: how to deploy the application, how to load balancing, how to deal with server downtime, how to deal with peak user requests, etc.</li></ul><p>Therefore, although SSR outperforms CSR in FCP (First Contentful Paint), it is not used on a large scale because of its high development and maintenance costs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UF50jAsxzzPPpSkB.png" /></figure><h3>When SSR meets Serverless</h3><p>In recent years, with the continuous improvement of the serverless ecosystem, we are thinking about whether the Serverless can bring new vitality to SSR. The answer is yes.</p><p>On the one hand, with the ability of functions as a service (FaaS), there is no need to build traditional Node applications, a function can become a service, and developers can focus more on application logic.</p><p>On the other hand, FaaS uses functions as a unit and is inherently scalable, which brings natural isolation and dynamic repair capabilities to SSR applications. Compared to traditional Node application, some boundary error may leads application fatal, these error can be controlled to a small extent in FaaS Mode.</p><p>Furthermore, FaaS allows users to write and deploy code without the hassle of worrying about the underlying infrastructure, which greatly reduces the threshold for developers of SSR applications.</p><p>Now, with the imagination brought by Serverless, and the work Rax has done on the engineering and Server-Side Rendering engine, deploying SSR applications can be much easier than it used to be.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cJqhgaEemMxqauxP.png" /></figure><h3>What Rax SSR brings</h3><p>The following points will give you a quick look of Rax SSR:</p><h3>Getting started with zero configuration</h3><p>Without complicated project configuration, with Rax CLI, you can quickly create an SSR project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/0*gRE4GGtn54qTv9Vt.gif" /></figure><h3>Extreme rendering performance</h3><p>Rax’s Server-Side Rendering engine uses a mixed rendering mode, and the rendering performance is 6 times faster than React.</p><pre>----------- compare renderToString ----------<br>React (16.12.0) #renderToString x 1,178 ops / sec ± 1.23% (85 runs sampled)<br>Rax (1.1.1) #renderToString x 6,047 ops / sec ± 1.73% (82 runs sampled)<br>Preact (10.2.1) #renderToString x 1,005 ops / sec ± 1.10% (86 runs sampled)</pre><pre>The benchmark was run on:<br>   PLATFORM: linux 5.0.0-1027-azure<br>   CPU: Intel (R) Xeon (R) CPU E5-2673 v4 @ 2.30GHz<br>   SYSTEM MEMORY: 6.782737731933594GB<br>   NODE VERSION: v10.18.1</pre><p>benchmark: <a href="https://github.com/raxjs/server-side-rendering-comparison">https://github.com/raxjs/server-side-rendering-comparison</a></p><h3>Serverless release mode</h3><p>Rax’s SSR project supports the Serverless release model, which can be released to Aliyun, AWS and other Serverless platforms, and can also be integrated into traditional Node.js applications based on express or koa.</p><p>Taking releasing the application to the cloud platform <a href="https://zeit.co/">ZEIT Now</a> as an example, there is no complicated application development and application process. In the existing Rax project, with a plugin for ZEIT Now, you can release your application quickly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cBOyrwci03LC43Sl.gif" /></figure><h3>Performance comparison</h3><p>Taking a real Rax SSR application with data request as an example, the performance comparison data shows that: under WIFI, the first contentfual paint time of SSR is about 2 times faster compared to CSR; in a weak network environment, SSR is about 3.5 times faster than CSR.</p><p>Screen recording: (left: SSR; right: CSR)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*H4HYj1wRVQ6sGjua.gif" /></figure><p>SSR Demo address: <a href="https://rax-demo.now.sh/ssr/home">https://rax-demo.now.sh/ssr/home</a><br>CSR Demo address: <a href="https://rax-demo.now.sh/csr/home">https://rax-demo.now.sh/csr/home</a></p><h3>Let’s start the SSR journey together</h3><p><a href="https://rax.js.org/ssr">https://rax.js.org/ssr</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1eddfb491f4e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>