title: OutputCache Flush Cache through an Action in an MVC 3 Application
body: <p>In many actions from the MVC application we are building up, we use OutputCache as follows:</p>
  
  <pre><code>[OutputCache(Duration = 3600, VaryByCustom = "language")]
  public ActionResult SomeAction()
  {
     //Action..
  }
  </code></pre>
  
  <p>So, I want to have an action where I can flush manually all these caches:</p>
  
  <pre><code>  public ActionResult RefrescarCache()
          {
              var keys = HttpContext.Cache.Cast&lt;DictionaryEntry&gt;().ToList();
  
              keys.ForEach(k =&gt; HttpContext.Cache.Remove(k.Key.ToString()));
              ViewBag.operationResult= "The cache was flushed succesfully!";
  
              return View();
          }
  </code></pre>
  
  <p>The thing, that it seems to not work. I will aprecciate any idea or advice you have!</p>