I'm trying to cache a page without the navbar of the page. When i cache the page its all works fine but I get unwanted behavior.
Explanation:
When I cache the index page for example, the navbar is also cached so if the user press the log-in button and log-on, the user redirect to the same page (Index) and the log-in doesn't take affect (the user name and the log out button doesn't appear), the log-in and register buttons still shows, its a problem.
This is my code:
Home Controller:
public class HomeController : Controller
{
[OutputCache(Duration=(60*60))]
public ActionResult Index()
{
return View();
}
// ...
}
Can I do Vary by something to prevent it ?