Does Datastore2 Cache stores?

In DataStore2, you can get a specific store for a player doing DataStore2(Player), but if I call it twice, does it return a cached value or creates a completely new one?

Anything that doesn’t have the word async in it, is cached.

Example:
:Get() - will return the value cached in the data store, if it exists.
:GetAsync() - same as Get , but will instead return a Promise instead of yielding.

https://kampfkarren.github.io/Roblox/api/#datastoregetasync

1 Like

That’s great to know, just to clarify, calling:

local Store = DataStore2(Player)

is cached, right?

Yes, that is cached since you have a reference to it.

If you update the datastore then attempt to get the cached data, you’ll need to access it again since variables are cached.

1 Like

Thanks, that is great to know.

1 Like