In NextJS14, which do you think is better between requesting from the server side and requesting from the client? Of course, I know that each situation is different, but basically, I thought it would be a good idea to make a request from the server component and run it on the client only for things that might put a load on the server or when real-time requests are needed. However, someone else said that since there is only one front server and CSR processes requests from the customer’s browser, CSR is basically good unless seo is needed or other situations… I’m worried because each person who talks has a lot of different stories. no see.
Which choice is better in each situation?
2
Answers
SSR gives a performance benefit for the end-user. Only with SSR we could realize Lighthouse Performance >90. Because SSR greatly reduces the initial download of JavaScript that needs to be parsed and executed.
On the interactive parts of the UI we use dynamically loaded client components that perform API server calls.
call it in server component, there are mechanism to cater for UI which are also server side rendered…the skeletonUI for streaming purposes, react suspense, sorry dont worry about managing UI from frontend with nextjs14….
You can check their documentation
The client component is needed in edge conditions when a hook is necessary.