Is VaryByCustom not working when I use it in Output cache or cached it wrong?
I spend whole day to figure out the problem but I couldn't: Here is the
problem: On the action I have output cache attribute:
[OutputCache(Duration = 600, VaryByParam = "*", VaryByCustom = "User")]
Also I've rewritten the Global.asax like this:
public override string GetVaryByCustomString(HttpContext context, string arg)
{
if (arg == "User")
{
return "User=" + context.User.Identity.Name;
}
return base.GetVaryByCustomString(context, arg);
}
But when I login first time it caches the values, then when I try to
logout and again login as different user I see the previous cached value.
While debugging I checked that Identity.Name returns correct results for
the first user it is "admin" for the second user it is "kate"
No comments:
Post a Comment