Expand my Community achievements bar.

SOLVED

Redis Integration with AEM

Avatar

Level 4

Hi,

 

Currently, we are calling the external service API and receiving the response in order to display the data. Assume we are calling the external services at 40 RPM. Because it is such a large number, we want to reduce the number of external calls as much as possible.

 

Previously, we used the Ehcache technique, which interfered with the internal AEM cache and occasionally corrupted the server. So we implemented a cache technique that is essentially a HashMap with the QueryParams as the key and the response as the value.

 

So we want to try Redis to cache the response. I found one YouTube link as a reference. Did anyone tried the Redis before or any other caching techniques implemented. 

 

https://www.youtube.com/watch?v=R9b38PXjBzQ&ab_channel=TechTalkwithRitesh.

1 Accepted Solution

Avatar

Community Advisor

Hi,

you need to write your own logic to store content in var wherever you receive the response or refresh it whenever is needed.



Arun Patidar
4 Replies

Avatar

Community Advisor

Hi,

You can try this if you are looking for memory cache

https://adobe-consulting-services.github.io/acs-aem-commons/features/http-cache/index.html

or use /var/yourproj/feature/cache to cache the response



Arun Patidar

Avatar

Level 4

Hi @arunpatidar,

 

Thank you for sharing your thoughts, I have went to the above reference link. It was hugely helpful.

How can we cache the response in the /var/yourproj/feature/cache folder? If you could please provide a link, that would be greatly appreciated.

Avatar

Community Advisor

Hi,

you need to write your own logic to store content in var wherever you receive the response or refresh it whenever is needed.



Arun Patidar

Avatar

Level 4

Hi,

I used the same approach as described in the link below to implement. For me, it works.

https://www.youtube.com/watch?v=R9b38PXjBzQ&ab_channel=TechTalkwithRitesh.