title: programmatically control output caching - disable or enable cache according to parameter value
body: <p>We've got a fairly standard e-commerce scenario with paged lists of products within categories. For better or worse, about 80% of visitors never navigate past the first page, depending on the category there may then be 5-10 more pages of results which are viewed far less often. (Yes we do optimise what appears on the first page and have good search - but that's a different discussion)</p>
  
  <p>We can't cache every single page of results, because we're constrained by memory, but the benefit of caching just the first page of results for each category would be huge.</p>
  
  <p>I know I could do something similar using object caching to store the datasets in question, but is this possible using output caching, perhaps by using the response.Cache object?</p>
  
  <p>Where in the page lifecycle could this be done? Pre-render?</p>
  
  <p>Much simplified, the URL is something like "/ProductList?Category=something&amp;Page=1" And I'd want logic something like (pseudocode):</p>
  
  <pre><code>If paramater "Page" equals 1
     Use output caching: vary by param = "categoryName; page"
  else
     Don't use caching at all, just render the page from scratch.
  </code></pre>
  
  <p>We're using ASP.NET 2.0, on IIS 6/win2003.</p>