In .Net 4.6.2, asp.net enables developer plug in async version of OutputCache module which is a good fit for the non-in-memory OutputCache data store. This OutputCache provider can use both CosmosDB(table model) and Azure storage table as the data store and leverages async operation to provide better scability.
$ dotnet add package Microsoft.AspNet.OutputCache.CosmosDBTableAsyncOutputCacheProviderTarget your application to 4.6.2+.
The OutputCacheProviderAsync interface was introduced in .NET Framework 4.6.2, therefore you need to target your application to .NET Framework 4.6.2 or above in order to use the Async OutputCache Module. Download the .NET Framework 4.6.2 Developer Pack if you do not have it installed yet and update your application�s web.config targetFrameworks attributes as demonstrated below:
<system.web>
<compilation debug="true" targetFramework="4.6.2"/>
<httpRuntime targetFramework="4.6.2"/>
</system.web>
Add the Microsoft.AspNet.OutputCache.OutputCacheModuleAsync NuGet package.
Add the Microsoft.AspNet.OutputCache.CosmosDBTableAsyncOutputCacheProvider NuGet package.
Use the NuGet package manager to install the Microsoft.AspNet.OutputCache.CosmosDBTableAsyncOutputCacheProvider packages. This will add a reference to Microsoft.AspNet.OutputCache.CosmosDBTableAsyncOutputCacheProvider.dll and add the following configuration into the web.config file.
<system.web>
<caching>
<outputCache defaultProvider="CosmosDBTableAsyncOutputCacheProvider">
<providers>
<add name="CosmosDBTableAsyncOutputCacheProvider" connectionStringName="StorageConnectionStringForOutputCacheProvider" tableName="[TableName]"
type="Microsoft.AspNet.OutputCache.CosmosDBTableAsyncOutputCacheProvider.CosmosDBTableAsyncOutputCacheProvider, Microsoft.AspNet.OutputCache.CosmosDBTableAsyncOutputCacheProvider, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</providers>
</outputCache>
</caching>
</system.web>
Now your applications will start using Async OutputCache Module with the CosmosDB OutputCache Provider.