AEM as cloud in memory object cache | Community
Skip to main content
Level 3
December 13, 2022
Solved

AEM as cloud in memory object cache

  • December 13, 2022
  • 3 replies
  • 1923 views

Hi

 

I'm looking fro in-memory key-value storage for object (not html pages or css or js) e.g list of cars 

 

something like Redis  that could be integrated easily to AEM as Cloud (not on premiss )

 

so i can access it within the server side code e.g getValue(string key) 

 

any ideas ? 

 

Thanks in advance 

 

Nir

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by nitesh_kumar-1

Hi @nirshani ,

 

In-memory cache is not supported by OOTB on the cloud. It's also not recommended. 

 

I have seen implementation with Ehcache or guava in past, but it runs into some problems in the CM build due to some issues with dependencies.

 

If you choose to store it in JCR as content (JSON), please make sure they are synched on the publishers due to the nature of the AEM Cloud.

Depending upon how you are developing the solution, In general, you could cache those responses on Dispatcher/CDN and check from the backend as well.

 

Or, move the logic to the front end In which case you have the default caching feature of CDN/Dispatcher to use, and also control over the expiration.

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/implementing/content-delivery/caching.html 

 

Regards,

Nitesh

 

3 replies

Jagadeesh_Prakash
Community Advisor
Community Advisor
December 13, 2022

@nirshani  I need more details on this. But from my understanding why not we use the AEM node structure?

nirshaniAuthor
Level 3
December 13, 2022

Thanks for the replay

let me re-phrase :  suppose  i'm consuming a service the returns list of available cars for particular date and location

i want to store this data cache for say an hour , so for the next client the will ask for same date and location i will not send the query again , just get it from cache. after one hour the result is expired

 

Redis is doing this exactly but i'm looking to AEM as Cloud solution 

 

hope is is clear now 🙂

Jagadeesh_Prakash
Community Advisor
Community Advisor
December 13, 2022

@nirshani Thank you for the details. I recommand you to use the jcr node structure for this functionality. 

 

1. For the first API call, save the data to the jcr node structure.

2. set the expiry date and time and every time clear the data in the node

2. until the secound call, the data will be their and data will be retrived 

nitesh_kumar-1
Adobe Employee
nitesh_kumar-1Adobe EmployeeAccepted solution
Adobe Employee
December 13, 2022

Hi @nirshani ,

 

In-memory cache is not supported by OOTB on the cloud. It's also not recommended. 

 

I have seen implementation with Ehcache or guava in past, but it runs into some problems in the CM build due to some issues with dependencies.

 

If you choose to store it in JCR as content (JSON), please make sure they are synched on the publishers due to the nature of the AEM Cloud.

Depending upon how you are developing the solution, In general, you could cache those responses on Dispatcher/CDN and check from the backend as well.

 

Or, move the logic to the front end In which case you have the default caching feature of CDN/Dispatcher to use, and also control over the expiration.

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/implementing/content-delivery/caching.html 

 

Regards,

Nitesh

 

arunpatidar
Community Advisor
Community Advisor
December 13, 2022
Arun Patidar