Diagathe Josué
Diagathe Josué

Reputation: 12076

Next.js - It is possible to make an app with next.js and an another server for backend application and be always good for SEO performances?

All is in the title:

It is possible to make an app with Next.js coupled to an another server for backend application and be always good for SEO performances ?

I'm trying to build an app with socket.io in Next.js. Seems I got to build an another server specifically for socket.io. By the same way Iwill use this server to handle databases requests and all.

I wonder if it always great for SEO performance to do that ? I mean, if SEO is good since my UI content will appear to crawler thanks to Next.js.

Any hint would be great, Thanks

Upvotes: 1

Views: 2617

Answers (1)

Dat Tran
Dat Tran

Reputation: 1586

It's good to separate to backend server and frontend server.

  • backend server (restful API/websocket/...): connect to database, do business logic and serve data for the client. The clients consuming this API include both server (server rendering) and client (client-side react application).

  • frontend server (next.js): Next.JS app helps you build a universal app which both render from serverside and clientside.

About socket.io, The mechanism of it is asynchronous. Emit event and listen to event are the two different things. I think it's only suitable for client side. You can use it for getting realtime data, update UI realtime. If the content need to be served for SEO, you should use RESTful API which help your app easily getting and prerender from server.

Upvotes: 3

Related Questions