Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

Sitemap update without iterating through JCR

Avatar

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

Avatar

Correct answer by
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

Avatar

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 · ...

Avatar

Correct answer by
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...