Hi all,
We have a api token which needs to be stored for 5 min for calling an api.
After 5 minutes,token gets expired.s
What is the best approach to store the token server side for 5 minutes before it get expired and how to sync the token in all the publishers.
Solved! Go to Solution.
Views
Replies
Total Likes
Hello @Sb2512
You can use EhCache or Apache JCS to implement cache.
Apache JCS (Java Caching System) provides various caching options, including in-memory caching, disk caching, and even distributed caching.
EhCache which caches the object at the JVM level.
https://www.ehcache.org/documentation/2.8/code-samples.html
http://blog.atish.me/2016/12/25/AEM-Ehcache/
@Sb2512 Why do you want to store the token on server side since the time duration is very less? Instead of storing the token on the server side, you can leverage either cookie or session storage to store the tokens for 5 minutes and after that expire the cookie or remove the session storage value.
Hope this help.
Hello @Sb2512
You can use EhCache or Apache JCS to implement cache.
Apache JCS (Java Caching System) provides various caching options, including in-memory caching, disk caching, and even distributed caching.
EhCache which caches the object at the JVM level.
https://www.ehcache.org/documentation/2.8/code-samples.html
http://blog.atish.me/2016/12/25/AEM-Ehcache/