Caching Custom Code Java Object

0 votes

Our game balance data is stored in separate documents of a collection. We have to extract (findDocument...) it quite oftenly in custom code requests in order to use it for game specific tasks that are executed on server. I was wondering how to implement caching of this data that doesn't change very often? It could increase the custom code execution time.

Is it possible to use java caching in custom code with App42?
asked Nov 24, 2014 in App42 Cloud API-BaaS by vladislav (10 points)

1 Answer

0 votes

Hello Vladislav,

You can apply caching on the client side in which you can store this value in local storage along with timestamp. You can read this value till specific time if it is available in local storage (For example 6 hours). If this value is not available or time has expired, you can fetch it back from server and update the local storage.

Let me know if it helps.

Himanshu Sharma

answered Nov 24, 2014 by hs00105 (2,005 points)
You advise to save the the value in the local storage, but we need to use this value inside the custom code which is executed on server. How is that possible?
There is no option to cache value in memory in Custom code. You have to use storage to save and fetch this value.
I hope your query has been resolved. Let us know if you need further assistance regarding this.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on