Last post Jun 23, 2017 01:18 PM by deepalgorithm
Jun 22, 2017 09:48 AM|sivangari|LINK
I need a cache a part of a page in MVC page.. So i have added the output cache in the controller. My questions that enough if we add that alone for caching or we need to do any other thing.
Another thing is , if we the caching is added in the top of the controller page, is it required to add the controller in the function again.
Please help me on htis
Jun 22, 2017 04:16 PM|deepalgorithm|LINK
My questions that enough if we add that alone for caching or we need to do any other thing.
This depends on your requirements. Output caching allows you to store the output of a particular controller in the memory. Any future request coming for the same action in that controller will be returned from the cached result.
This is different than caching data, where you store objects in server memory.
is it required to add the controller in the function again.
Page output caching can be added to the individual controller action or an entire controller class. Whatever suits your requirement.
Jun 23, 2017 06:19 AM|sivangari|LINK
Thanks for u r reply.. Another query, it is required if we add output caching in the entire class and again shall we add the controller in the function.
Jun 23, 2017 01:18 PM|deepalgorithm|LINK
The OutputCache attribute can be applied either on an individual action method or on the entire controller.
So if you apply it at the class level, then you do not need to apply it to your action methods.
Please mark the answer accepted if it helped you, so others can benefit from it as well. Thanks