更新时间:2021-08-19 22:18:25
我相信这篇文章是关于你想做的事情:这里.你可以这样做:
I believe this article is about what you want to do: here. You can do something like this:
var context = WebOperationContext.Current;
HttpResponseHeader cacheHeader = HttpResponseHeader.CacheControl;
String cacheControlValue = String.Format("max-age={0}, must-revalidate", maxCacheAge);
context.OutgoingResponse.Headers.Add(cacheHeader, cacheControlValue);