コード例 #1
0
        public async Task UpdateContentAsync(HttpResponseMessage notModifiedResponse, CacheContent cacheContent)
        {
            var newExpires = HttpCache.GetExpireDate(notModifiedResponse);

            if (newExpires > cacheContent.Expires)
            {
                cacheContent.Expires = newExpires;
            }
            //TODO Copy headers from notModifiedResponse to cacheContent

            await _contentStore.UpdateEntryAsync(cacheContent);
        }
コード例 #2
0
 public CacheContent CreateContent(HttpResponseMessage response)
 {
     return(new CacheContent()
     {
         CacheEntry = this,
         Key = CreateSecondaryKey(response.RequestMessage),
         HasValidator = response.Headers.ETag != null || (response.Content != null && response.Content.Headers.LastModified != null),
         Expires = HttpCache.GetExpireDate(response),
         CacheControl = response.Headers.CacheControl ?? new CacheControlHeaderValue(),
         Response = response,
     });
 }