title: Caching API responses in .NET Core
body: <p>I'm building a website that will have a feature that if you hover over an object, a special div will be filled with ajax with details on the object.</p>
  
  <p>Since the client side isn't really that important, I'll just say that there's jquery hover event on certain elements that trigger ajax <code>.load()</code> with <code>https://api..../GetDetails/*Id*</code> url and that function will fetch the item details via EntityFramework and the View will be something like</p>
  
  <pre><code>@model Details
  
  &lt;h1&gt;@Model.Name&lt;/h1&gt; 
  </code></pre>
  
  <p>(again, simplified because it's not the point).</p>
  
  <p>But with the growing userbase, and the fact that a person can just swipe their mouse around like a madman, I figured that not caching this would create a problem with the traffic flow.</p>
  
  <p>Is it possible, and if it is, how can I cache the responses so that</p>
  
  <p><code>https://api..../GetDetails/ABC</code> always returns the same thing without doing all the math behind and that <code>https://api..../GetDetails/DEF</code> does not return ABC but it's cached as well?</p>