0

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.

2
  • 2
    It likely as you described. But it's unclear from the description whether client-side app makes use of SSR render with hydrate (it preferably should for performance reasons) or re-renders it from scratch with render. which I believe is Synchronous - renderToNodeStream isn't, use it. Commented Dec 23, 2018 at 7:18
  • I hadn't looked into hydrate - thankyou and I'll investigate renderToNodeStream... Greatly Appreciated...! Commented Dec 23, 2018 at 8:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.