I have an MVC .net site and I am attempting to leverage OutputCache for performance gain.
/// <summary>
/// Broker View Page
/// </summary>
/// <returns></returns>
[Route("{lang}/brokers/details/{id}/{code}", Order = 1)]
[Route("brokers/details/{id}/{code}", Order = 2)]
[OutputCache(Duration = (60 * 60), VaryByParam = "none")]
public ActionResult View(int? id, string code)
{
This delivers a huge performance gain on 2nd and subsequent visits to a site, but I have just discovered one huge Gotcha!
If a client visits the page anonymously, subsequently logs in and returns to the page, they are still served up the unauthenticated view (authenticated clients should see the same content, but different header)
is there any way I can use OutputCache to keep my performance gain, but have it smart enough to know about authenticated/unauthenticated differences?