title: Response cache not working in asp.net core project
body: <p>I try to implement Response cache in asp.net core project but its not working.This is <code>startup.cs</code>:</p>
  <pre class="lang-cs prettyprint-override"><code>public void ConfigureServices(IServiceCollection services) 
  {
    services.AddResponseCaching();
    services.AddMvc();
  }
  
  public void Configure(IApplicationBuilder app, IHostingEnvironment env) 
  {
      app.UseResponseCaching();
  
      if (env.IsDevelopment()) 
      {
        app.UseDeveloperExceptionPage();
      }
  </code></pre>
  <p>And this is my controller.</p>
  <pre class="lang-cs prettyprint-override"><code>[ResponseCache(Duration = 30)]
  public IActionResult Index() 
  {
    ViewBag.IsMobile = RequestExtensions.IsMobileBrowser(ContextAccessor.HttpContext.Request);
    return View();
  }
  </code></pre>
  <p>But still cache control header id</p>
  <pre><code>cache-control →no-cache, no-store
  </code></pre>
  <p>Where I am lacking please help. This response cache is not working and I take guidance from Microsoft document.</p>