We are using MVC Donut Caching and have been all day trying to debug this problem which I still didn't manage to find a solution.
We have opted to start using the DonutOutputCache attribute over the OutputCache and through logging have noticed that certain partial view actions which have the DonutOutputCache attribute are not being cached as per the caching parameters.
We have a View (index) with the following nested partial views. The ones which have the donut cache attribute specified are listed in square brackets.
- _LayoutMainBase.cshtml
- _Header (PartialView)
- _HeaderBottomStrip (PartialView)
- _HeaderMainMenu (ParialView)
[DonutOutputCache(Duration = 3600)]
- _HeaderMainMenu (ParialView)
- _HeaderBottomStrip (PartialView)
- RenderBody() (HomeController.Index)
[DonutOutputCache(Duration = 3600)]
- ...
- _Header (PartialView)
Through logging, we have discovered that the _HeaderMainMenu Partial View Action is actually being called multiple times in less than an hour time.
This is not happening:
- If we revert to the OutputCache attribute
- When testing locally on our work stations
Any insight towards what could be the reason?
Thanks for you help!