r/reactjs • • Oct 30 '26

Needs Help SEO for a large React SPA?

I'm working on a React/Vite SPA with React Router 7 and an ASP.NET Core 10 backend.

SEO is important since the site will eventually have hundreds of thousands of public pages covering games, groups, events and news, with multiple languages. Some content changes frequently.

I know Google can render JavaScript, but other crawlers like AI search engines and social previews, seem less capable. Also, rendering JavaScript requires more resources, which might mean less crawl coverage.

I've been looking at a few solutions for SEO:

1. Server-injected HTML (ASP.NET Core)
- Pros: Let ASP.NET serve the SPA and inject page-specific metadata (title, description, canonical, hreflang, JSON-LD, Open Graph) along with a small HTML summary containing headings, key information and internal links. React takes over when loaded. No additional runtime or major frontend refactor, and everything runs on a single ASP.NET host.
- Cons: Crawlers that don't execute JavaScript only see the summary rather than the full page content. React also replaces the initial HTML which could cause a brief flicker.

2. React Router 7 SSR
- Pros: Full server-rendered HTML for crawlers. Probably the most natural SSR option since I'm already using React Router 7.
- Cons: Requires a separate JavaScript runtime alongside ASP.NET and a fairly significant refactor of the public pages and their data fetching. More complexity around hosting and maintaining multiple services.

3. Next.js with ISR
- Pros: Can generate pages on demand and regenerate them when needed, which seems particularly useful for such a large number of dynamic pages.
- Cons: Would mean migrating the frontend to Next.js, along with additional hosting complexity and another runtime to maintain.

The first option seems like the simplest solution, but I'm not sure if it's enough. Ideally, I'd prefer full SSR, but that seems to involve a much larger refactor and considerably more complexity when it comes to hosting and maintaining the application.

Is server-injected HTML with meaningful page content enough for good indexing, or would SSR/ISR make a significant difference?

Anyone with experience running SEO-heavy SPAs using a similar approach

4 Upvotes

15 comments sorted by

9

u/fredkreuger Oct 30 '26

If you're still starting out, or relatively early, I'd recommend swapping entirely to react ssr using one of the frameworks. Don't rely on sunk cost to not use the right tool for the job.

If you're retrofitting an existing application, that changes the calculus a bit, but would still recommend react ssr on top of the aspnet backend, simply because the initial conversion cost will likely be smaller than the long term maintenance of trying to shoehorn what you want into what you've already got.

6

u/No_Cattle_9565 Oct 30 '26

Have you looked at tanstack start?

-3

u/[deleted] Oct 30 '26

[removed] — view removed comment

2

u/No_Cattle_9565 Oct 30 '26

It's certainly better than next.js. I don't think its a problem using dotnet as a backend. You'd just deploy it alongside it so you have no problems. I haven't done it at scale but we use it with Go without problems 

3

u/SoftwareNegative8783 Oct 30 '26

With that many pages, return a real 404 status for missing items. SPAs often send 200 for everything. Google calls those soft 404s and wastes crawl budget. Also split sitemaps by content type.

3

u/nameupp Oct 31 '26

ngl migrating a 500k-page app to next.js or babysitting a separate node/bun ssr cluster alongside dotnet is a massive operational headache you'll regret in prod. tbh if aspnet core already owns your data layer and cache, having dotnet render semantic server-side html for the public read views and only mounting react islands on the interactive bits (or dropping an edge worker in front for crawler caching) gets you 99% of the seo benefits without the multi-runtime circus imo

1

u/lefinehq Oct 31 '26

Since you mention multiple languages, put the language in the URL path (/de/games/...) and not in a cookie or Accept-Language, otherwise there's no separate URL to put in hreflang and crawlers only ever see one version. And generate the hreflang tags and the sitemap from the same locale map on the server so they can't drift apart when you add a language

1

u/chillerfx Oct 31 '26

React.net uses react 16 for SSR, it has an extentable methods, and actually I find it better than next ir node based solutions for ssr

1

u/ganeshjoshidev Nov 02 '26

For the social preview and AI crawler part specifically, your option 1 already covers it. Link preview bots (Slack, WhatsApp, X, LinkedIn) generally read only the HTML your server sends and don't run your JS, so title, description, og:image, canonical and hreflang have to be in that first response.

Quick test: curl one of your pages and look at the raw HTML. If the meta tags and a short summary are there, the crawlers that skip JS are covered, and full SSR becomes a question of Google's rendering budget rather than a must-have.

1

u/Alone-Ad4502 Nov 02 '26

Google renders JS but the cost of retrieval of each page is higher, it counts every ajax request as crawl budget as well.

the simpliest solution is prerender: serve complete html for bots and CSR for users. We have an open-source rendering core https://github.com/EdgeComet/engine/ and a commercial product built on top of it.

1

u/Chris_Lojniewski 27d ago

One thing that might change the calculus: you probably don't need SSR for the whole app, only for the public pages. Games, groups, events, news detail pages are what crawlers hit. Anything behind login can stay a plain SPA forever.

RR7 framework mode lets you do that route by route, so it's not the big refactor it sounds like. Start with the one page type that gets the most search traffic, server render it, leave the rest. You also keep ASP.NET as the API, the Node part just renders.

On option 1, the catch for AI search specifically: the bots that don't run JS will only ever see your summary. So the summary becomes the answer engines' version of your page. If it's thin (title, two lines, links), that's what gets quoted, or nothing does. Fine for social previews, weak for being cited.

Easy check either way: curl -A "GPTBot" https://yoursite/games/some-game and see what's actually in there.

Small extra idea if AI search matters to you: a plain markdown version of each public page, linked from the head. Cheap to generate from the data you already have, and the non-JS bots read it fine. We do that in our open source Next.js starter (nexity.build) and the same thing works as an RR7 resource route.

(I run a Next.js shop, so take the "add a Node renderer" advice with that in mind, but RR7 is the natural path here, not a rewrite.)

1

u/Xtreme_Neon Oct 30 '26

server-injected html with real content is usually enough for google, and it handles social previews and most ai crawlers fine as long as the main content is in the first response. the risk is keeping the injected html and the react output in sync across hundreds of thousands of pages. a middle path is to cache the html per route on the aspnet side and only hydrate the interactive parts. i'd test a few templates with plain curl and search console's url inspection before committing to a full ssr migration.

1

u/phpHater0 Oct 30 '26

Tbh nextjs seems like a no brainer. You can still keep the .net backend and use nextjs just as a frontend, it supports ssr by default out of the box and you can just make small interactive parts client components. You get the best of both worlds.

And the migration cost isn't as high as you think if you use AI, considering Nextjs itself uses react, a good chunk of your code would be unchanged.