I use the awesom MVCDonutCaching package from Nuget to cache entire pages, leaving some portions without access. The process is simple and everything works as it should:
I cache as follows:
[DonutOutputCache(CacheProfile = "FiveMins")] public ActionResult Index() { return View(); }
In the section of my page I do not want to cache, I do the following:
@Html.Action("HeaderLinks","Home", true)
This works as it should, and the main part of the page is cached, but my link headers are context-sensitive links that display the login button if the user is not logged in, their username, if any, etc. . - not cached, while everything works.
The problem I encountered is that the title links belong to the wizard / layout page and are used throughout the board - regardless of whether the Action has the DonutOutputCache attribute set or not. When I create another action, let me call it βabout us,β without the donut cache attribute. I don't see the title link at all
public ActionResult AboutUs() { return View(); }
Looking at the source code, I see the following
Obviously, in the above example, which is generated by the donut caching library, the link section is replaced with some XML comment.
My question in a nutshell: Is it possible for this library to reuse the same child action, regardless of whether the parent action uses cache cache or not?
Any help would be appreciated.