Allow GetAsync to bust cache

GetAsync caches its value for 10 seconds – if you call GetAsync again on the same key within those 10 seconds, it instantly returns the last value it got (even if the key has been updated externally since then) and doesn’t use a request. Caching requests is usually a good idea, but sometimes we need to bust the cache to get the actual value. Currently that’s not possible with GetAsync – the only way to do it is with UpdateAsync. Note the limitation chart below:

blob.png

UpdateAsync uses up requests for the Sets request type. I’m not a fan of having to use my Sets requests in place of Gets to get the most recent value of my key. That effectively halves the amount of requests I have to work with if I’m needing to get the uncached, true value of specific keys often. It’d be great if there was a second, optional boolean parameter of GetAsync which allowed us to bust the cache.

3 Likes

This issue plauged me for over a month and forced me to shutdown a bit feature of my game. This really needs to be changed. And from my experience, updateAsync caches for 20 seconds after a previous request which is really bad for obvious reasons.

1 Like

I agree that this is an issue, but I am curious why you need uncached gets. Can you provide examples where you want to fetch the latest value with GetAsync and aren’t getting it?

Have 10 identical values in datastore which are updated all at once. Load each value every 1 second.

Boom.

Anti-cache hack.

Dont try this at home, developers.