I am developing a React app with NodeJS backend.
I will provide an SSR of every page of the app (which will also be cached to Redis to reduce duplicate renders) to ensure a strong SEO experience. This will be the default for accounts/spiders not logged in (no active session).
When users login they will receive a SPA (React bundle) and run a React/Redux environment with API calls for more data.
Is this a fair way to build a React environment that also caters to SEO? Any obvious flaws or better solutions? It's the first time I've tried SSR.
I don't really want to use Next.JS etc so plan to use reactDomServer to render to string which I believe is synchronous so will take the extra server load into consideration.
import ReactDOMServer from 'react-dom/server';
Also the site will run Adsense which shouldn't make any difference in a SSR/CSR environment.
Are there an issues delivering SSR pages to Spiders (with no state) and the having an SPA that delivers the same pages with state. eg: some pages will have 2 slightly different versions? I assume no.
hydrate(it preferably should for performance reasons) or re-renders it from scratch withrender. which I believe is Synchronous - renderToNodeStream isn't, use it.