Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

Implementation of "top 5 articles" component

Avatar

Level 3

Hi there

We have implement a component that does a live check against the JCR to return the 5 most viewed articles. By live i mean that every time the page is loaded the component queries the JCR. This component is also included in the majority of the pages in the site

The implementations is as follow,. We run a query which returns all articles

path=/content/mysite/en_GB/home type=cq:Page property=jcr:content/article/sling:resourceType property.value=/mysite/components/content/article p.limit=-1

We then iterate through the results and for each result we make an API call to PageviewReport to get how many times the page has been viewed over a period of time. 

Our concern is that this implementation is having an impact on performance, resulting in page loads failing SLA's. We also have SiteCatalyst. Will it be more efficient to get the page views information from analytics? Or we keep the current implementation but introduce a more efficient away of retrieving the article "viewed" information from the JCR  

1 Accepted Solution

Avatar

Correct answer by
Employee

I think using Sitecat for this use case is your best bet. I have done something similar here:

https://github.com/dkuntze/acs-ars

It uses sitecat reports. It may not map directly to what you are requiring, but it should get you most of the way there.

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

I think using Sitecat for this use case is your best bet. I have done something similar here:

https://github.com/dkuntze/acs-ars

It uses sitecat reports. It may not map directly to what you are requiring, but it should get you most of the way there.