I like how I can use [OutputCache] on my controller actions.
I have a few methods that aren't controller actions that I would like to add simple caching to, is there something similar to [OutputCache] that I could use on non-controller actions? I have a method which hits a web-service that I want cached independently of the controller action that displays its data.
I just want an attribute which is a wrapper around HttpContext cache for normal methods.
AFAIK, there is nothing built-in. But you could build one if you will. If you are using .NET 4.0 you could use the System.Runtime.Caching assembly which provides many useful methods for caching data in .NET applications (not only web applications). You could also take a look at a technique called function memoization.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With