ASP.NET Core provides both in-memory caching and response caching. Let's say that the app is ASP.NET Core WebAPI that brings data from SQL database to users with configured Responce Caching middleware. In what case is it useful to use a memory caching also?
ASP.NET Core supports two types of caching out of the box: In-Memory Caching – This stores data on the application server memory. Distributed Caching – This stores data on an external service that multiple application servers can share.
Response caching reduces the number of requests a client or proxy makes to a web server. Response caching also reduces the amount of work the web server performs to generate a response. Response caching is controlled by headers that specify how you want client, proxy, and middleware to cache responses.
What is an In-Memory Cache? An in-memory cache is a data storage layer that sits between applications and databases to deliver responses with high speeds by storing data from earlier requests or copied directly from databases.
These caching strategies are supposed to play a quite different role:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With