GetAsync() Question

GetAsync() gets cached for 4 seconds, if I set it to a variable is the reference accurate? Or should I deepcopy the returned value?

Yes, It will is accurate, I would recommend using a protected call,

Pretty sure you should deepcopy because I’m guessing you’re using tables, but any other value doesn’t get the same treatment as tables (e.g str..'a' creates a new string instead of changing the original)

I think I heard that GetAsync() returns a copy? Not sure though, definitely going to deepcopy the metatags

As mentioned in this announcement, Datastores: Caching on GetAsync

Caches return a stale result so you would need to deepcopy the table. Although later in the announcement it does mention they are removing the cache for GetAsync soon.

1 Like