2

I am a java developer who is upskilling myself and learning React, so that I can develop frontend application completely using React. But I read couple of articles which states that it could cause SEO related problem but some states that this problem historic, now Google crawlers are smart enough to read Single page application.

Is it advisable to develop application completely using React without anything else? Or do I need to implement pre-rendering or server side rendering?

Earlier I have worked on on project where we developed application using php+vue, but I do not want to use any other language in my new application, apart from React. so is it possible?

Note: I am planning to develop e-commence application so SEO part is critical for me.

2
  • As far as I've experienced, having pages with content prerendered has a reasonable impact on your SEO rankings. I think search engines assume that some people might disable javascript by default for all websites... What backend stack are you using? I assume that would be spring boot? Did you already try this?
    – Pieterjan
    Feb 8, 2022 at 10:19
  • Yes @Pieterjan, I am using spring boot for backend. So you suggest I should go ahead with prerender? or GraalVM. I would prefer pre-render as per my limited knowledge.
    – user3790198
    Feb 8, 2022 at 12:12

1 Answer 1

3

Prerendering can only be used when your application only has static pages. When you want to render variable data (from the database) in your application, you're tied to server-side rendering, which requires NodeJS on the server (which seems to be provided through this GraalVM...).

So if you're in a position where you have NodeJS available on the server, I would surely setup server-side rendering. You will probably need to pass data from Spring Boot to React during SSR. I don't know how either Spring Boot nor React deal with this actually. I only have experience with ASP.NET Core + Angular.

I'm positive that something similar will be out there for Spring Boot and React, but I won't be able to help you with that.

Update

You're (the web browser actually) using client-side rendering anyway, anyhow, anytime.

For SEO purposes, you enable either 1. server-side rendering OR 2. prerendering on top of this.

Server-side rendering actually runs your javascript front-end in NodeJS and returns the result to your backend stack (ASP.NET Core / in your case SpringBoot) which serves it. For this to work, you need to have NodeJS available on the server. However, you'll be able to pass variable data (from the database) to the SPA during SSR.

For prerendering, you need to run an npm command on your development machine, which generates HTML for all your pages. This results in plain HTML, CSS and javascript files which you need to upload on your very basic file server. As a consequence, you won't be able to display information from your database on your pages.

3
  • Thanks @pieterjan, I will definitely go through your suggestions.
    – user3790198
    Feb 9, 2022 at 4:08
  • Is it fine if I use all three in same application i.e. SSR, CSR and pre-rendering. As I have few pages which are static, few which will be depend of backend API's response and few pages which I do not need to be crawled as those are post login pages. Will it become too heavy if I use all three ?
    – user3790198
    Feb 9, 2022 at 4:43
  • You seem a little confused. I've added a clarification on the differences between SSR/prerendering
    – Pieterjan
    Feb 9, 2022 at 11:12

Your Answer

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