This is a high demanded feature for web api users. It's better to make it to be a built in feature or a nuget package.
Currently, there is no official sample code, blog about it. The most popular community blog about it is:
, but it seems not to implement the full features as MVC outputcache like support cache profile.