AemaaCS - dynamic page generation and robots/sitemap | Community
Skip to main content
Level 9
May 16, 2024
Solved

AemaaCS - dynamic page generation and robots/sitemap

  • May 16, 2024
  • 4 replies
  • 3597 views

Hi all,

Was hoping to seek suggestions from the group here on thoughts 

I need pages dynamically generated from a source and authoring is not an ask , update can happen to the source every min as part of content refresh from source 

given this I see an option and noted questions 

on loading a page with query param 

 

1. have a single template laid out and replicated

2. use query param and based on it get a response that will be consumed and using sly include include a resource passing independent page component as  models as req object to the components for rendering the content 

3.- I don’t believe selectors is used these days ? Like a.12344.html and selector 12344 is used to generate content ? 
4.- what happens to the OOTB sitemap generator ? It definitely would not show the query param based url in the sitemap since these are dynamic pages . Am I mistaken you think ?

 

kind regards,

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Nitin_laad

Hi @nitrohazedev , you should be able to achieve given ask following the below steps - 

1. Automated Data Retrieval:

To ensure your content stays up-to-date, consider setting up a scheduled service. This service will run at regular intervals (e.g., hourly, daily) and automatically fetch the latest data from your external source and store it in AEM Repo. 
2. Event-Driven Updates ():

User workflow launcher or event listener to trigger workflow or servlet, based on add/Modification of source property in AEM
3. Dynamic Page Management:

Servlet or workflow process will take care of below - 
Creating new AEM pages based on the retrieved data.
Updating existing pages to reflect any changes in the data.

4 replies

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
May 16, 2024

Hi,

 

Sorry, I don’t fully understand your question, but a query string is definitely not the best approach. I suggest creating a servlet that receives a JSON payload containing all the details for page creation. The page creation process should be straightforward. As for the sitemap, it should be updated using a scheduled job to ensure that your new page is added the next time it runs, for example, at midnight.

 

Hope this helps.

Esteban Bustamante
Level 9
May 16, 2024

No worries , Why would query param not be the right approach ?
The need is to not store in AEM , no authoring is the ask . Also the content needs a refresh every sec not worth running scheduler on publisher (or author) and persisting nodes or creating pages. Think of it as a single page that displays dynamic data. Imagine components that retrieve dynamic data on a page  . Given this the question arises with sitemap 

Nitin_laad
Community Advisor
Nitin_laadCommunity AdvisorAccepted solution
Community Advisor
May 16, 2024

Hi @nitrohazedev , you should be able to achieve given ask following the below steps - 

1. Automated Data Retrieval:

To ensure your content stays up-to-date, consider setting up a scheduled service. This service will run at regular intervals (e.g., hourly, daily) and automatically fetch the latest data from your external source and store it in AEM Repo. 
2. Event-Driven Updates ():

User workflow launcher or event listener to trigger workflow or servlet, based on add/Modification of source property in AEM
3. Dynamic Page Management:

Servlet or workflow process will take care of below - 
Creating new AEM pages based on the retrieved data.
Updating existing pages to reflect any changes in the data.

Level 9
May 16, 2024

The need is to not store in AEM , no authoring I the ask . Also the content needs a refresh every sec not worth running scheduler on publisher (or author) and persisting nodes . Besides with running scheduler on pub , not sure what caveats we would run into on cloud . 

joerghoh
Adobe Employee
Adobe Employee
May 18, 2024

I understand that you have an external source, and AEM needs to deliver the content based on that source. And as that source can receive changes at any time, these changes need to be reflected on the content generated by AEM as well.

 

A few questions:

  1. Is there any personalization on top of that content source? In other words: Is there only 1 valid version of the content AEM needs to generate at any time?
  2. What is the requirement regarding the latency from "change on source" to "AEM displays this change"? Real-time (that means less than 5 seconds)? 5 minutes? 1 hour?
  3. What's the expected traffic hitting for this content? Total number of requests per day plus number of requests per minute in peak?

With these additional information it's possible to come up with a few ideas and build an application design for it.

 

 

 

Level 9
May 18, 2024

Thanks @joerghoh  as always , please find the responses below. I have used selectors in the past combined with resource type to ensure component design is brought in with dynamic data but pls let me know. The components exist in AEM and I planned to bring in a model on load that would have child model resources like text title etc that I would include on the main page via includes and res type feeding in data via setters for backend.i know AEMaaCS  can do it and want to suggest its use 

 

 

Is there any personalization on top of that content source? In other words: Is there only 1 valid version of the content AEM needs to generate at any time?
- [NZ] No personalization needed , the page might be generated from a search results link with an id as a query param that page will query and display and all of data on it is dynamic . The layout is fixed with placeholders for content that might or might not exist in json that gets fed into it. Now search can provide like 60 80 200 results and some or all of these on click takes to a page that displays content dynamically. There will be analytics tracking and for SEO- robots or sitemap I guess I will have to write a separate sitemap xml to have these query param urls for crawler to crawl and track 

 

What is the requirement regarding the latency from "change on source" to "AEM displays this change"? Real-time (that means less than 5 seconds)? 5 minutes? 1 hour?
[NZ] - Real time is the ask , immediate on load for user . So if a user clicks the search page and json was updated this should be reflected even if it updated as the click occurred .

 

What's the expected traffic hitting for this content? Total number of requests per day plus number of requests per minute in peak?

[NZ]- I don’t have the answer for this yet since the folks haven’t gotten back to me on this one , but this can be huge , I can get back on this.Since it is a public site so the traffic is assumed to be heavy wrt requests. There appears no limit on api requests.   It’s a new page that didn exist and migration to AEM is the ask 

Level 9
May 19, 2024

I am not a frontend architect, so I cannot give you good recommendations how to integrate that dynamic data into the resulting DOM. Probably depends quite a bit on the nature of the data you integrate and if they are simple key-value pairs or needs to include structure on its own.

Of course if you do the frontend integration, the URL should look like this: /path/to/page.html#id=value

In this case the CDN/dispatcher will always cache the "/path/to/page.html" response, and the anchor ("id=value") is only handled client-side. That means that

/path/to/page.html#id=1
/path/to/page.html#id=2

will always only fetch /path/to/page.html from the CDN/dispatcher and not cause any load to AEM.


@joerghoh Apparently I can’t inbox due to the limit for private messages set 

 

totally understand I am not a front end person as well and so trying within AEM

I planned to use backend only to reuse the existing components which is the ask and pass data massaged through backend into respective component placeholders via resource include , which wouldn’t be necessarily heavy. The ask is that these pages generated from search with unique id needed to render pages from AEM do not need to be cached

I would imagine if it is a single static template with no content and with content brought in like with script or minor backend, we do not need caching at all. I understand cache hits but can be evaded with #id= but yet it would be something like components having Ajax calls independently where content is dynamic ?

 This page is rendered (dedicated to the request id) through some means of page click( there can be around 20-30 page variations in terms of content not layout) . Considering this as rendering would query param be ideal like the search that’s dynamic in nature and not cached ?
This link contain id  like  ?id=1234 or #id=1234 where Ajax does the logic of getting data from source and either options would make it dynamic. Wouldn’t this function like the front end except that js would get the data and place into the placeholders ?
iWhat if I used say #id=1234 to please caching and do it all in AEM yet ?

kautuk_sahni
Community Manager
Community Manager
May 20, 2024

@nitrohazedev Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni