0
votes

I need to cache the page specific to logged in user. So I used as mentioned below:

[OutputCache(Duration = 10, VaryByParam = "Id", Location = OutputCacheLocation.Client)]
public ActionResult PartialPageOutputCaching(string Id)
{
     return PartialView("PartialPageOutputCaching");
}

OutputCacheLocation.Client did not work for me as it is serving new request every time. I tried to search storing page output cache specific to user, but could not find the right working sample. Please let me know, how OutputCacheLocation.Client suppose to work.

I tried VaryByParam = "Id" assuming that, based on the action methods parameter page content will be cached, but looks like it works on query string parameter. Please confirm how VaryByParam suppose to work.

Thanks in advance.

1

1 Answers

0
votes

OutputCacheLocation.Client means that it will cache on the client, meaning in the browser your user is using. Also there is really not much advantage of caching for a specific user, as user already has the page rendered and chances that he will open the same page are small to take advantage of that cache.