SPA Server Side approach

Avatar

Avatar
Boost 1
Level 1
sumantap8752196
Level 1

Like

1 like

Total Posts

10 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
sumantap8752196
Level 1

Like

1 like

Total Posts

10 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
sumantap8752196
Level 1

05-06-2020

I am evaluating how is it possible to implement Server Side Rendering in SPA app with React and AEM as content service. This is the approach I see Next.js suggest to have per-rendered and all most all CMS system suggests:

 

1. User request a page from react app running on Node server

2. Node server requests JSON data from CMS through fetch call

3. Then React App reads this JSON and transform HTML into String like renderToString() and sends the response back to the user.

 

The disadvantage of this approach is that if JSON data from CMS is huge then first request takes long time. What alternate solution do you suggest?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,153 posts

Correct reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,153 posts

Correct reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

08-06-2020

Answers (1)

Answers (1)

Avatar

Avatar
Boost 250
MVP
Nikhil-Kumar
MVP

Likes

251 likes

Total Posts

262 posts

Correct reply

38 solutions
Top badges earned
Boost 250
Validate 1
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Boost 250
MVP
Nikhil-Kumar
MVP

Likes

251 likes

Total Posts

262 posts

Correct reply

38 solutions
Top badges earned
Boost 250
Validate 1
Ignite 3
Ignite 1
Give Back 5
View profile
Nikhil-Kumar
MVP

25-08-2020

@sumantap8752196 

We also faced the similar issue regarding the size of the JSON as higher the number the pages, higher will be the :children array set and more time it takes.

Try setting up Gzip at the server level and try caching the JSON at Cloud Front.
Gzip compression helped us reducing the size of the JSON loaded thereby reduce the load time.

Also, try to raise a day care ticket and check with the Adobe Team as well.

Thanks,
Nikhil