Calling InstantiateAsync twice, result in only one load?

I’m still grasping Addressables and having a few questions on knowing what is going on internally. This is a fairly simple question, say I had the following.

assetRef.InstantiateAsync();

//Some amount of time passes here, and assetRef is successfully loaded and instantiated.

assetRef.InstanteAsync();

In the above scenario, will the second assetRef be created immediately? Meaning, the information is NOT loaded again from the remote server (or whatever the storage case is)? Does the Addressables system automatically know that the data is already loaded and doesn’t need loaded again?

I want to make sure calling InstantiateAsync() twice isn’t going to result in loading the data from the server twice.

This same question could be said for LoadAssetAsync(). Will calling it twice or more load the asset multiple times, or will it know it’s already loaded (or in the process of being loaded) and disregard it?

In both cases a second load should not be triggered, the reference count will increase each time which may/may not be desirable, the second instantiate should be almost immediate. Bear in mind some assets may load but not be visible, collider will still be present. This may require that the shader/material be reattached, in cases like this or you need to instantiate many assets consider using assetReference.LoadSceneAsync()

In my own use case I wrapped InstantiateAsync() & ReleaseInstance

public void Instantiate()
{
if (!isInstantiated)
{
isInstantiated = true;
AOHandle = AR.InstantiateAsync();
AOHandle.Completed += OnLoadDone;
}
}

public void ReleaseInstance()
{
if (isInstantiated)
{
isInstantiated = false;
AR.ReleaseInstance(gObject);
}
}

this insures the reference count is either 0 or 1, when 0 the addressable system will unload the asset.

https://docs.unity3d.com/Packages/com.unity.addressables@1.16/manual/LoadingAddressableAssets.html

Best of luck.

Ok good to hear, glad it handles this itself. Thanks much for the help!