コード例 #1
0
ファイル: CacheItemTester.cs プロジェクト: kelong/JuniorRoute
			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);
			}
コード例 #2
0
		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();
		}
コード例 #3
0
        private static ResponseHandlerResult WriteResponseInCache(HttpResponseBase httpResponse, CacheItem cacheItem)
        {
            cacheItem.Response.WriteResponse(httpResponse);

            httpResponse.Headers.Set("Last-Modified", cacheItem.CachedUtcTimestamp.ToHttpDate());

            return ResponseHandlerResult.ResponseWritten();
        }