Hello Team,
Let me try to explain our problem, We have a large number of pages (around 200+ pages)
and these are all structured pages with some data points. We have an end-user landing page, this page has a couple of filters to filter the results.
As of now we're processing all pages data on an ajax call and returning the data to the browser on page loading.
With this approach, the page is getting timeout errors/slow rendering sometimes.
We've decided to implement the memory cache on publishing nodes and return the cache to the end-user page.
So, What's the best way to flush the cache ? or any better thoughts on this approach.?
Solved! Go to Solution.
Hi @vmadala!
Caching is a very important topic in the context of AEM. You should always aim to cache as much as possible on all available layers.
Your application architecture and requirement is not 100% clear to me from your explanation but I would definitely look at the following options for caching and performance tuning (probably in this order):
Please note: While caching is quite easy, invalidation is hard to get right.
While approaches for invalidation of the dispatcher cache are quite clear in general, the most relevant part is always about your application and content architecture and can hardly be advised without more detailed insights.
Hope that helps!
Hi @vmadala
Keeping data in memory cache will surely save unnecessary query on publishers.
In your scenario you can invalidate memory cache receiving node/page activation event.
And it is always helpful to create small tool for full cache invalidation where admin/superauthor can invalidate
A standard way to serve a secure and fast website experience will be to use the standard AEM dispatcher Apache web server module.
Checkout this in-depth video to understand exactly what AEM dispatcher is, https://www.youtube.com/watch?v=i5dzqbpCwGk
@vmadala What's the format of key-value pair in in-memory cache?
Are you storing the query as the key and its results as the value? You could probably write a servlet and pass the key as an argument to delete.
Also, it would be worth checking if indexing (in case you're using sql/ xpath queries) can be done to improve the performance.
Hi,
Create a collection variable(ideally a Map with page path as key and content as value) as a global variable at a OSGi service. You can clear the data/cache of Map variable in activate/deactivate method or by registering an activation event or by a servlet with specific parameters either to flush entire data or only specific page paths data.
Thanks,
Harish.
Views
Replies
Total Likes
Hi,
You can check https://adobe-consulting-services.github.io/acs-aem-commons/features/http-cache/subpages/architectur... if heps
Hi @vmadala!
Caching is a very important topic in the context of AEM. You should always aim to cache as much as possible on all available layers.
Your application architecture and requirement is not 100% clear to me from your explanation but I would definitely look at the following options for caching and performance tuning (probably in this order):
Please note: While caching is quite easy, invalidation is hard to get right.
While approaches for invalidation of the dispatcher cache are quite clear in general, the most relevant part is always about your application and content architecture and can hardly be advised without more detailed insights.
Hope that helps!
Views
Likes
Replies
Views
Likes
Replies