Caching In Web API

In this article we will are going to learn how we can use caching in Web API. Normally caching is the process of storing data somewhere for the future requests, in our case we can avoid the unwanted hit to database to get the data if we cache the data somewhere.

C# (9.3 MB)
4.6 Star
1,600 times
Add to favorites
E-mail Twitter Digg Facebook
Sign in to ask a question

  • Nice, but one important feature missing
    1 Posts | Last post March 12, 2017
    • Hi. 
      Nice tutorial. But I think theres one important part missing: What if the DB request takes up to 10 seconds? Then the client has to wait that time, which you always should try to prevent. I think it's about calling the action method again and pushing the (correct and formatted) result into the cache while delivering an outdated item in the meanwhile. Any solution for this?
  • OWIN Approach
    1 Posts | Last post December 28, 2016
    • Hi, 
      Great demo, thanks for sharing!
      Is this approach valid for OWIN?
      If so, does it rely also on System.Runtime.Caching or there is a specific nuget package that should used?