OutputCache / ResponseCache VaryByParam
<p><code>ResponseCache</code> is somewhat a replacement for <code>OutputCache</code>; however, I would like to do server side caching as well as per parameter input. </p>

<p>According to some answers <a href="https://stackoverflow.com/a/31054389/1284637">here</a> and <a href="https://stackoverflow.com/a/27311194/1284637">here</a>, I should be using <code>IMemoryCache</code> or <code>IDistributedCache</code> to do this. I'm particularly interested in caching on controllers where the parameter is different, previously done in asp.net 4 with <code>OutputCache</code> and <code>VaryByParam</code> like so:</p>

<pre><code>[OutputCache(CacheProfile = "Medium", VaryByParam = "id", Location = OutputCacheLocation.Server)]
public ActionResult Index(long id) 
{ 
    ///...
}
</code></pre>

<p>How would I go about replicating this in asp.net core?</p>