title: How does ASP.NET MVC OutputCache works when VaryByParam is not specified
body: <p>What is used as the cache string (key) when <code>VaryByParam</code> parameter of the <code>OutputCache</code> is not specified?</p>
  
  <pre><code>[OutputCache(Duration = 30)]
  public ActionResult Index(int customerId, Foo foo, Bar bar)
  {
      /* ... */
  }
  </code></pre>
  
  <p>I couldn't find any documentation on how the caching behaves when <code>VaryByParam</code> (or <code>VaryByCustom</code>) is not specified. What is used as the key?</p>
  
  <p>By doing some quick tests, it seems to me like all the parameters of the action are used for the cache key. But how does the caching work when <strong>some of the parameters are objects</strong> (like these <code>foo</code>, <code>bar</code> parameters)? Does it use their hash code? Or does it use the form/querystring variables in the request instead?</p>
  
  <p>I couldn't find sufficient documentation on this topic, however I think it's crucuial to understand these implementation details to avoid future bugs and misconceptions about the caching mechanism.</p>
  
  <p>I am mostly interested in ASP.NET MVC version 5, however if anybody knows some history about the <code>OutputCache</code> attribute, I think this information is very useful as well.</p>
  
  <p>Thanks for the answers or links!</p>