public void SetUp() { _cacheResponse = new CacheResponse(new Response().OK()); _cachedUtcTimestamp = new DateTime(2012, 01, 01, 0, 0, 0, DateTimeKind.Utc); _expiresUtcTimestamp = new DateTime(2013, 01, 01, 0, 0, 0, DateTimeKind.Utc); _cacheItem = new CacheItem(_cacheResponse, _cachedUtcTimestamp, _expiresUtcTimestamp); }
private static async Task<ResponseHandlerResult> WriteResponseInCacheAsync(HttpResponseBase httpResponse, CacheItem cacheItem) { await cacheItem.Response.WriteResponseAsync(httpResponse); httpResponse.Headers.Set("Last-Modified", cacheItem.CachedUtcTimestamp.ToHttpDate()); return ResponseHandlerResult.ResponseWritten(); }
private static ResponseHandlerResult WriteResponseInCache(HttpResponseBase httpResponse, CacheItem cacheItem) { cacheItem.Response.WriteResponse(httpResponse); httpResponse.Headers.Set("Last-Modified", cacheItem.CachedUtcTimestamp.ToHttpDate()); return ResponseHandlerResult.ResponseWritten(); }