예제 #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,
     });
 }