Using Cache in ASP.Net MVC

If you want to make your pages faster to load, you can make use of Cache by using Cache filter.

If you simply want to add Cache capability for a one page, then add

This will give you 120 seconds of cache.

If you want to manage cache for multiple pages, then I recommend creating profiles and manage it at Web.config like below,

then calling these profiles like below;

You can read more detail at : https://msdn.microsoft.com/en-us/library/system.web.mvc.outputcacheattribute(v=vs.118).aspx

Leave a Reply