Sign In Register

How can we help you today?

Start a new topic
Answered

SparkCache question(s)

so referencing https://docs.gamesparks.net/documentation/cloud-code-api/utils-cloud-code-api/sparkcache.

There is a sentence that always confused me:

"Cached objects are backed by mongo, so if an item is expired, when you try to access it again it will be reloaded."


er?  Is that sentence referencing the way Mongo caches data? or SparkCache (a la redis?)

Obviously if I put something in SparkCache - IT doesn't know where it came from - so if it 'expires' - it couldn't possibly reload from an unknown source.





Best Answer

Jeff,


The sentence you mention is referencing the SparkCache - not the way Mongo caches data.


Objects placed into SparkCache are backed by a Mongo database on disk. So when the element expires, and you request it from the cache, the data can be reloaded from Mongo (by key). So the original source of the data may be unknown (i.e. any data you create) but the cache's own disk datastore is certainly not unknown to the cache.


Regards,


Jonathan.

1 Comment

Answer

Jeff,


The sentence you mention is referencing the SparkCache - not the way Mongo caches data.


Objects placed into SparkCache are backed by a Mongo database on disk. So when the element expires, and you request it from the cache, the data can be reloaded from Mongo (by key). So the original source of the data may be unknown (i.e. any data you create) but the cache's own disk datastore is certainly not unknown to the cache.


Regards,


Jonathan.

Login to post a comment