title: How can I remove individual HTTP responses from the .NET cache?
body: <p>I have an ASP.NET MVC controller with a method that returns a file and is decorated with [HttpGet].</p>
  
  <p>The first time it is called it gets the file and before returning it has the code:</p>
  
  <pre><code>ControllerContext.HttpContext.Response.Cache.SetExpires(DateTime.Now.AddDays(7));
  ControllerContext.HttpContext.Response.Cache.SetCacheability(HttpCacheability.Public);
  ControllerContext.HttpContext.Response.Cache.SetValidUntilExpires(false);
  </code></pre>
  
  <p>Subsequent requests to this [HttpGet] method return the file from the cache, so the method is not even reached on the HTTP request.</p>
  
  <p>Elsewhere is code that deletes these files from the file system, but subsequent requests pull the response from the cache, so the files can still be downloaded.</p>
  
  <p>How can I remove these items from the cache when I delete the files?</p>