당연히 될줄 알았지만 생각보다 쉽게 된다.
==
15 private void SetCaching(WebOperationContext context, DateTime lastModifiedDate, Int32 maxCacheAge){
16
17 // set CacheControl header
18 HttpResponseHeader cacheHeader = HttpResponseHeader.CacheControl;
19 String cacheControlValue = String.Format("max-age={0}, must-revalidate", maxCacheAge);
20 context.OutgoingResponse.Headers.Add(cacheHeader, cacheControlValue);
21
22 // set cache validation
23 context.OutgoingResponse.LastModified = lastModifiedDate;
24 String eTag = context.IncomingRequest.UriTemplateMatch.RequestUri.ToString() + lastModifiedDate.ToString();
25 context.OutgoingResponse.ETag = eTag;
26
27 }
==
원본 http://blogs.msdn.com/b/justinjsmith/archive/2007/08/22/setting-http-headers-in-wcf-net-3-5.aspx
==
15 private void SetCaching(WebOperationContext context, DateTime lastModifiedDate, Int32 maxCacheAge){
16
17 // set CacheControl header
18 HttpResponseHeader cacheHeader = HttpResponseHeader.CacheControl;
19 String cacheControlValue = String.Format("max-age={0}, must-revalidate", maxCacheAge);
20 context.OutgoingResponse.Headers.Add(cacheHeader, cacheControlValue);
21
22 // set cache validation
23 context.OutgoingResponse.LastModified = lastModifiedDate;
24 String eTag = context.IncomingRequest.UriTemplateMatch.RequestUri.ToString() + lastModifiedDate.ToString();
25 context.OutgoingResponse.ETag = eTag;
26
27 }
==
원본 http://blogs.msdn.com/b/justinjsmith/archive/2007/08/22/setting-http-headers-in-wcf-net-3-5.aspx
'프로그래밍 > C# & .NET' 카테고리의 다른 글
AppFabric (ESB + DataGrid) - 윈도우즈서버 새 기능 (0) | 2010.06.28 |
---|---|
WCF REST 구현시 URL Rewriting (0) | 2010.06.28 |
WCF로 REST 개발이 된다. VS 2010에서 세팅하기 (0) | 2010.06.28 |
WCF가 몬가 했더니.. (0) | 2010.06.25 |
WCF (Windows Communication Foundation) Quick Tutorial (0) | 2010.06.25 |