Most real-world enterprise apps fetch data from various data sources such as third-party DB, web services, and most importantly the web APIs are deployed either on cloud or server farm environment.
In the preceding cases, in-memory won't serve the purpose of caching as it's web server memory-based. To provide a more robust cache strategy across a deployed environment, it's recommended to use a distributed cache.
The distributed cache stores the data on a persistent store instead of web server memory, in this way cache data is available across the deployed environment.
The actual data store gets fewer requests than in-memory, therefore distributed cache survives the web server restarts, deployments, or even failure.
Distributed cache can either be implemented with Sql Server or Redis using the IDistributedCache interface.
...