I have a REST based WCF service which returns JSON data as response. To improve performance Output Caching is enabled with location as ANY and duration 1 hr. I want to allow clients to cache the response for a period of 1 month while keeping the data cached on the server for only 1 hr, to do this i added the following lines in my code
HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(30));
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.Public);
but this value is overridden by the Output Caching profile value. How can i override the value set by the Output Caching profile