1 of 4

SPA on Magnolia

Internet

CDN

(optional)

Load

Balancer

Magnolia

Public 1

Magnolia

Public 2

Magnolia

Public n

JCR

JCR

JCR

Magnolia

Author

JCR

Light Modules

SPA

Publish

author-instace.com

All instances read Light Modules from one place

  1. Fetches page
    • index.html + js, css

  • Calls REST
    • /.rest/my-endpoint

index.html + js, css files served by Magnolia from

/.resources/my-ligh-module/webresources/

  1. User access my-domain.com
  2. Request hits CDN. Either CDN serves the content or goes next. Usually static files would be served over CDN. REST calls depending on CDN settings.
  3. Request hits load balancer.
  4. Load balancer redirect request to one of the public instances.
  5. Public instance returns SPA (index.html + js, css files).
  6. SPA calls REST on /.rest/my-endpoint

my-domain.com

2 of 4

SPA outside Magnolia (e.g. AWS, Netlify, etc.)

Internet

CDN

(optional)

Load

Balancer

Magnolia

Public 1

Magnolia

Public 2

Magnolia

Public n

JCR

JCR

JCR

Magnolia

Author

JCR

Light Modules

Publish

author-instace.com

All instances read Light Modules from one place

Server serving SPA static files (index.html + jss, css)

SPA

2. Calls REST

    • public-instance.com/.rest/my-endpoint
  1. Fetches page
    • index.html + js, css

  1. User access my-domain.com
  2. External server serves SPA (index.html + js, css files).
  3. SPA calls REST on public-instance.com/.rest/my-endpoint

my-domain.com

public-instance.com

It can have multiple instances with�LB and/or CDN in front of it

Author instance for WYSIWYG in Pages app fetches page

SPA knows it is WYSIWYG preview thanks to url query param and point 2 knows to fetch REST from author-instance.com/.rest/my-endpoint

3 of 4

SPA with SSR outside Magnolia (e.g. Next.js)

Internet

SPA with SSR

SPA

Load

Balancer

Magnolia

Public 1

Magnolia

Public 2

Magnolia

Public n

JCR

JCR

JCR

Magnolia

Author

JCR

Light Modules

Publish

public-instance.com

author-instace.com

All instances read Light Modules from one place

my-domain.com

It can have multiple instances with�LB and/or CDN in front of it

Author instance for WYSIWYG in Pages app fetches page

SPA with SSR knows it is WYSIWYG preview thanks to url query param and point 2 knows to fetch REST from author-instance.com/.rest/my-endpoint

2. Calls REST

    • public-instance.com/.rest/my-endpoint
  • Fetches fully rendered page

  • User access my-domain.com
  • SPA with SSR server calls REST on public-instance.com/.rest/my-endpoint
  • SPA with SSR returns fully rendered page to user

SPA with SSR

SPA

4 of 4

SPA with Ecommerce

Internet

SPA with SSR

SPA

Load

Balancer

Magnolia

Public 1

Magnolia

Public 2

Magnolia

Public n

JCR

JCR

JCR

Magnolia

Author

JCR

Light Modules

Publish

public-instance.com

my-domain.com

SPA with SSR

SPA

Ecommerce Hybris, Commercetools, Salesforce

Load

Balancer

CDN