Expand my Community achievements bar.

SOLVED

AEM as cloud in memory object cache

Avatar

Level 3

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

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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/conten... 

 

Regards,

Nitesh

 

View solution in original post

5 Replies

Avatar

Community Advisor

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

Avatar

Level 3

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

Avatar

Community Advisor

@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 

Avatar

Correct answer by
Employee Advisor

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/conten... 

 

Regards,

Nitesh