adobe / aem-project-archetype

Maven template to create best-practice websites on AEM.
https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/archetype/overview.html
Apache License 2.0
547 stars 426 forks source link

SPA Page Publishing #604

Open ahumphreys87 opened 3 years ago

ahumphreys87 commented 3 years ago

Hi, I'm having an issue with an SPA Editor site where none of my content is rendering on the publish instance when I publish a content page. I need to also publish the root page in order for changes to render. Is this an expected issue? Is there any config I can tweak to make it work as desired?

Expected Behaviour

When I publish a page, the root model json should be updated so that my page gets the latest content updates on the publisher

Actual Behaviour

The page model is updated but the root model is not. This means my SPA still gets old content. In order for the new content to appear I need to publish the root page too. NOTE: en

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Create an SPA app using the archetype. Edit home page, publish homepage. Notice content isnt updated on the homepage. Now publish the langage root. Notice the homepage now renders latest content

Platform and Version

AEM as a Cloud Service

Sample Code that illustrates the problem

site structure of: /content/my-site/en/home Root model is defined as en.model.json

I can see on the publish instance that /content/my-site/en/home.model.json is updated but /content/my-site/en.model.json is not

Logs taken while reproducing problem

bpauli commented 3 years ago

@pfauchere Can you please have a look into this issue? Thanks!

ahumphreys87 commented 3 years ago

Note I can workaround this by updating the root level, so that no subpages are included in the initial root model but this has a slight performance impact as we request 2 json models