Updated on Kisan Patel
To cache the output of the action method, we can use OutputCache
attribute in the action method of the controller.
[OutputCache(Duration=30)] public string Index() { return DateTime.Now.ToString(); }
The output of this action method will be cached for 30 seconds from the current date.