How to Regenerate Static Pages in Angular SSR When CMS Data Changes Without Rebuilding the...

Discussão em 'Angular' iniciado por שריתי, Março 1, 2025.

  1. שריתי

    שריתי Guest

    I'm working with Angular 18 and implementing Angular SSR for my app. All my data is dynamic and fetched from a CMS (like Umbraco). Even some of my routes are determined dynamically from the CMS, but I can retrieve them from the sitemap, so that part is not an issue.

    Additionally, my routes contain dynamic parameters (e.g., /product/:id), so any solution should take this into account when regenerating pages.

    I know that one way to achieve this is by rebuilding the app to generate new static pages, but I want to avoid rebuilding all pages every time the CMS data changes.

    My Questions: 1.I can detect when content is updated in the CMS (e.g., via a publish event), but how can I trigger Angular SSR to generate a new static page for the updated content without rebuilding the whole app? 2.If a user interacts with the page (e.g., adds an item to a list, causing a view change), how can I ensure that Angular regenerates the static page accordingly? Any guidance or best practices for handling this scenario in Angular SSR, especially considering dynamic routes with parameters, would be greatly appreciated!

    Thanks in advance!

    Continue reading...

Compartilhe esta Página