Improve your server-response times up to 90% with React on Rails PRO!
“Anybody who regularly hits six digit request numbers a day is going to be in for a bad time. React on Rails PRO is perfect on this case. Do you want your app to randomly crash sometimes in hard to predict ways? Then Execjs is perfect for you.”
Caching Server Rendering
Fragment Caching View Helpers
Fragment caching is available via the cached_react_component and cached_react_component_hash view helpers. This includes lazy evaluation of props. Such fragment caching saves a ton of CPU work for your web server and greatly reduces the request time.
Node React Server Side Render
The "React on Rails Pro Node React Server-Side-Renderer" provides more efficient React Server Side Rendering on a standalone Node JS server.
Overall Management Memory and CPU
A separate Node rendering server is easier to manage in terms of monitoring memory and CPU performance, allocating dynos, etc. This also makes it easier to manager the ruby servers, as you no longer have to consider the impact of starting an embedded V8.
Proper Node Tooling
Caching of React Rendering
To limit the load on the renderer server or embedded ExecJS, caching of React rendering requests can be enabled by a config setting. Because current React rendering requests are idempotent (same value regardless of calls), caching should be feasible for all server rendering calls.
Rolling Restart of Node Workers
Why should I use React on Rails Pro if ExecJS seems to work?
Caching is extremely useful to any server rendering you're doing, with or without ExecJS. React on Rails pro support caching at 2 levels:
1 - Caching of rendering request to ExecJS (or the Node renderer). This avoids extra calls to ExecJS.
2 - Fragment caching of server rendering. This avoids even the calculations of prop values from the database and the cost of converting the props to a string (lots of CPU there)
By doing such caching, you will take a CPU load off your Ruby server as well as improving response time. And this is with virtually no code changes on your part.