Please explain to me briefly about the cache profile within MVC with example.
Define cache profile in MVC.
449411-Feb-2020
Updated on 11-Feb-2020
Home / DeveloperSection / Forums / Define cache profile in MVC.
Please explain to me briefly about the cache profile within MVC with example.
Nishi Tiwari
11-Feb-2020We can create a cache profile in the web.config file and it is an alternative to configuring output cache properties by modifying properties of the [OutputCache] attribute. It also offers a couple of important advantages which are as follows.
First, take a look at a simple example of a cache profile by creating the cache profile on web.config file. These <caching> section must appear within the <system.web> section.
We can apply the Cache10Min profile to a controller action with the [OutputCache] attribute which is as follows.
Run the application and specify the following URL http://localhost:63004/employee
If we invoke the Index() action as shown above then the same time will be returned for 10 Min.