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
  • 3590 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 23, 2024

When you add the topic sitemap and search engines, I think that you might end up with implementing both approaches:

* Use the selector-based approach to render a version for the search engines. It will also include a JS snippet, which switches to the "anchor-based approach" ("#") if a browser visits that URL (and it will silently ignore the values in the page).

* A use the "anchor-based approach" for browsers, which then can directly reach out to the backend.

 

Then you can reference the selector-based URLs in the sitemap. Depending on the capabilities of the search engine crawler it either behaves like a browser and fetches live data as well from the backend, or it will fetch the embedded values (as determined by the selector).

 

For the request of your question: I don't get what my mean with the different ID values, switching between them and what to display to the user. 

 

When you use the anchor-based approach ("#"), AEM will never know what kind of value you will display, and for what reason it only render the frame of the page. It's then the task of the Javascript in the browser to obtain these values from the backend and display them within the page. No page with values is cached anywhere.

 

 

 


Thank you @joerghoh 

That’s the approach I think works best  .having selector makes things a lil easier with backend 

 

my question was more towards below statement but I guess I get the jist 

 

 with https://www.site.com/page.id1.html#id=id1

the above caches id1 version due to selector but js silently switches to values with #id1, however id1 is not gonna do anything 😉 like a different rendition 

 

You sir are the best! I just didn think of both

 

 

 

 

 

 

 

 

 

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