且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

WCF 向 HTTP 响应添加额外的 HTTP 标头以传输 SOAP 消息

更新时间: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);