I got a requirement to be able to retrieve content from AEM repository on a web page once it is published, ie. retrieve the latest publish content.
Doing that is somehow ineffective if we have a large number of content inside the repository already.
any sorts of suggestions / best practice how to do it?
Use client side jquery ajax ($.ajax) or Apache Sling Dynamic Include or any other similar framework
Thanks for the reply Joerg!
What I wanted to say on the second paragraph is basically one of the possibility to fetch the latest published content from the JCR. However it is not a really good solution (ineffective) as it is using the JS Use API which is a server-side language and potentially put a heavily load on the server.
so to summarise it, the question is basically, is there any other solutions that we can implement to fetch the latest published content so that the user can get suggestions on the latest published article once the article is published?
I don't have the details of your requirement but on a high level, you will have to create an endpoint in your aem (using servlet). These endpoint will be responsible for sending response with updated content. From front-end you will be requesting these endpoint and consume the response.
Some helpx articles you can refer to