It seems that others have answered the main question, which is: do not configure page caching in the page / cshtml file in MVC3 +, use the Action method in the controller.
However, for more complex scenarios, you can access the WebCache object using the Razor syntax.
Some of these scenarios are the old Donut / Donut (or Donut / Dounut) caching. The MVC3 theme is focused here on Stack Overflow .
Also found is the NuGet MvcDonutCaching package mentioned by Denis Huvelle that solves the problem for 3 and 4 - but I have not tested it.
From orbonia
source share