Best practice azure cache

110 Views Asked by At

We are using the Azure Managed Cache service. I was reading this article about how to implement the cache. The example they use is

DataCacheFactory cacheFactory = new DataCacheFactory();
DataCache cache = cacheFactory.GetDefaultCache(); 

I am wondering if that is best practice? I have read else where that you should use a singleton for the DataCache object in order to reuse the connection, but then have read elsewhere that with the managed cache service that connection pooling is enabled by default and you don't have to implement a singleton.

Can anyone clarify what is the correct way to call the managed cache service?

0

There are 0 best solutions below