Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Sitemap update without iterating through JCR

brolinuk
Level 2
Level 2

I am creating a sitemap from part of my JCR. I am happy to iterate the JCR when first time creating it, but really don't want to re-iterate every time a request come in to pickup the latest content.

I would assume there is some thing like a listener to catch the change that have been made in the JCR where my sitemap generate from. If so, I only needs to update the sitemap file already generated, with some process with the changes has been caught by the listener.  Please advise if there is such listener and it would be great to advise some practical implementation. Thanks in advance.

1 Accepted Solution
edubey
Correct answer by
Level 10
Level 10

Typically a sitemap is updated after 12hr or 24hr via a scheduled job which takes care of iterating JCR structure once and caching it in dispatcher till next version of sitemap gets generated by job.

Making changes in existing file might created overhead if these changes are large number also, I am not sure if updating sitemap as content changes will really create big impact for next few hours. (probably something you should consider)

All said..

ResourceChangeListener [1] event handler are preferred way as compared to JCR Event Handler

[1] https://github.com/Adobe-Consulting-Services/acs-aem-samples/blob/master/bundle/src/main/java/com/ad...

View solution in original post

2 Replies
smacdonald2008
Level 10
Level 10

"Like a listener to catch the change that have been made in the JCR "

AEM supports JCR NODE event handlers. That may be a way to proceed here. See the example here: acs-aem-samples/SampleJcrEventListener.java at master · Adobe-Consulting-Services/acs-aem-samples · ...

edubey
Correct answer by
Level 10
Level 10

Typically a sitemap is updated after 12hr or 24hr via a scheduled job which takes care of iterating JCR structure once and caching it in dispatcher till next version of sitemap gets generated by job.

Making changes in existing file might created overhead if these changes are large number also, I am not sure if updating sitemap as content changes will really create big impact for next few hours. (probably something you should consider)

All said..

ResourceChangeListener [1] event handler are preferred way as compared to JCR Event Handler

[1] https://github.com/Adobe-Consulting-Services/acs-aem-samples/blob/master/bundle/src/main/java/com/ad...

View solution in original post