Adding in Output Caching Globally On All Controllers
First off, you can enable global 'OutputCacheAttribute ' to cache all of your controllers. This approach is a bit more flexible than having to add it to each action on your site, as recommended in several sources. In order to add the cache globally. you need to add the following into your global.asax .
protected void Application_Start()
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
Duration = 900,
VaryByParam = "*"
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
Software Architect, Programmer and Technologist Jon Jones is founder and CEO of London-based tech firm Digital Prompt. He has been working in the field for nearly a decade, specializing in new technologies and technical solution research in the web business. A passionate blogger by heart , speaker & consultant from England.. always on the hunt for the next challenge