private static void SetResponseHeaders(HttpResponse response, CacheItem item, TimeSpan cacheDuration, WebCompressionKind compressionKind) { response.ShouldNotBeNull("response"); response.AppendHeader("Content-Length", item.Data.Length.ToString()); response.ContentType = item.ContentType; if(item.IsCompressed) response.AppendHeader("Content-Encoding", compressionKind.ToString().ToLower()); var cache = response.Cache; // NOTE : HTTPS 에서도 동작하기 위해 cache.SetRevalidation(HttpCacheRevalidation.AllCaches); cache.SetCacheability(HttpCacheability.Public); // Cache Expiration 설정 cache.SetExpires(DateTime.Now.ToUniversalTime().Add(cacheDuration)); cache.SetMaxAge(cacheDuration); cache.SetAllowResponseInBrowserHistory(true); }