using System.Collections.Generic; using System.Web.Http; namespace CacheControl_test.Controllers { public class ValuesController : ApiController { // GET api/values // Ignore all parameters [MyCacheOutput(30, true, true)] public IEnumerable Get() { return new string[] { "value1", "value2" }; } // GET api/values/5 // Ignore post [MyCacheOutput(30, false, true)] public string Get(int id) { return "get value"; } // POST api/values // Ignore get [MyCacheOutput(30, true)] public string Post([FromBody]IEnumerable value) { return "post value"; } // PUT api/values/5 // cache all [MyCacheOutput(30)] public string Put([FromUri]int id, [FromBody]string value) { return "put"; } } }