title: ResponseCache attribute does not cache data on client side
body: <p>In ASP.NET Core application I have a action method that returns some data. I wanted to cache this data <strong>on client side</strong>. So based on the <a href="https://docs.asp.net/en/latest/performance/caching/response.html" rel="noreferrer">documentation here</a> i can use <code>ResponseCache</code> attribute on the action method. This attribute adds <code>Cache-Control</code> header in response</p>
  
  <blockquote>
    <p>Response caching refers to specifying cache-related headers on HTTP
    responses made by ASP.NET Core MVC actions. These headers specify how
    you want client and intermediate (proxy) machines to cache responses
    to certain requests (if at all). This can reduce the number of
    requests a client or proxy makes to the web server, since future
    requests for the same action may be served from the client or proxy’s
    cache.</p>
  </blockquote>
  
  <p>also </p>
  
  <blockquote>
    <p>Response caching does not cache responses on the web server. It
    differs from output caching, which would cache responses in memory on
    the server in earlier versions of ASP.NET and ASP.NET MVC.</p>
  </blockquote>
  
  <p>So this is how my action method looks</p>
  
  <pre><code>public class LookupController : Controller
  {
      [HttpGet]
      [ResponseCache(Duration = 120)]
      public IEnumerable&lt;StateProvinceLookupModel&gt; GetStateProvinces()
      {
          return _domain.GetStateProvinces();
      }
  }
  </code></pre>
  
  <p>Then i call the method using browser as <a href="http://localhost:40004/lookup/getstateprovinces" rel="noreferrer">http://localhost:40004/lookup/getstateprovinces</a>
  Here is the request and response headers</p>
  
  <p><a href="https://i.stack.imgur.com/lWj9k.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lWj9k.png" alt="enter image description here"></a></p>
  
  <p>Notice that Response Headers has <code>Cache-Control: public,max-age-120</code> as expected.
  However if refresh the page using F5 (before 120 seconds), the debugger breakpoint inside GetStateProvince action method alway hits. That means its not cahing the data on client side.</p>
  
  <p>Is there anything else i need to do to enable client side caching?</p>
  
  <p><strong>Update</strong>
  I have tried using IE, Chrome and also POSTMAN with no luck. Everytime i type the url in address bar or hit refresh the client ( that is browser or postman) makes a call to action method.</p>