Server Side Rendering Optimization
See original GitHub issueSteps to reproduce
git clone https://github.com/shaundr/react_ssr
cd react_ssr && bundle && yarn && bundle exec rails s
open localhost:3000
Expected behavior
Timely server side rendering, perhaps parallelized?
Actual behavior
~140ms per HelloWorld example
System configuration
Sprockets or Webpacker version: 4.0.7 React-Rails version: 2.6.0 Rails version: 5.1.7 Ruby version: 2.6.1p33
I’ve been hoping to SSR some of an application, however it appears to be too slow. I’m sprinkling React into the views with the react_component
helper, which can result in quite a few components mounting. It looks like React-Rails renders them serially via ExecJS. Has anyone looked in to batching or parallelization?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Server-Side Rendering Optimization - Spartacus Documentation
Server -Side Rendering optimization allows you to fine tune your SSR setup, and gives you more ways to resolve potential issues related to...
Read more >Server-Side Rendering Performance: Overview
Read an overview on how to build fast server-side rendered PWAs, by leveraging the Mobify Platform's caching and other techniques.
Read more >Server Rendering in JavaScript: Optimizing Performance
This often is why people mistakenly assume client-side rendering can have better performance than SSR. The same page loaded with client-only ...
Read more >Server-side rendering - Apollo GraphQL Docs
Server -side rendering (SSR) is a performance optimization for modern web apps. It enables you to render your app's initial state to raw...
Read more >Improve app performance with React server-side rendering
React server-side rendering offers performance benefits vs. client-side rendering. Learn about different React SSR frameworks.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep, in your project this is really slow!!! Definitely unacceptable!
It’s because you’re using ExecJS directly. So lets use NodeJS 😃
Oh dear…
So lets use a JS engine that doesn’t suck.
Wait, you’re telling me there are JS engines better than NodeJS? Yes I am, it’s
mini_racer
and it’s ruby based!WOW so fast. Why isn’t this a project dependency? Well it’s because JRuby users can’t use mini_racer, they have to use the_ruby_rhino (I feel bad for them).
Yeah maybe we need to make this much more explicit in the README, PR welcome!!
@BookOfGreg you are amazing, thank you.