1 instantiation of ResponseCachingMiddleware
Microsoft.AspNetCore.ResponseCaching.Microbenchmarks (1)
ResponseCachingBenchmark.cs (1)
33
_middleware = new
ResponseCachingMiddleware
(
58 references to ResponseCachingMiddleware
Microsoft.AspNetCore.ResponseCaching (8)
ResponseCachingExtensions.cs (3)
9
/// Extension methods for adding the <see cref="
ResponseCachingMiddleware
"/> to an application.
14
/// Adds the <see cref="
ResponseCachingMiddleware
"/> for caching HTTP responses.
21
return app.UseMiddleware<
ResponseCachingMiddleware
>();
ResponseCachingMiddleware.cs (3)
33
/// Creates a new <see cref="
ResponseCachingMiddleware
"/>.
74
_logger = loggerFactory.CreateLogger<
ResponseCachingMiddleware
>();
396
throw new InvalidOperationException($"Another instance of {nameof(ResponseCachingFeature)} already exists. Only one instance of {nameof(
ResponseCachingMiddleware
)} can be configured for an application.");
ResponseCachingOptions.cs (2)
7
/// Options for configuring the <see cref="
ResponseCachingMiddleware
"/>.
20
/// If the response body exceeds this limit, it will not be cached by the <see cref="
ResponseCachingMiddleware
"/>.
Microsoft.AspNetCore.ResponseCaching.Microbenchmarks (1)
ResponseCachingBenchmark.cs (1)
20
private
ResponseCachingMiddleware
_middleware;
Microsoft.AspNetCore.ResponseCaching.Tests (49)
ResponseCachingMiddlewareTests.cs (48)
22
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache, keyProvider: new TestResponseCachingKeyProvider());
41
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache, keyProvider: new TestResponseCachingKeyProvider("BaseKey"));
56
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache, keyProvider: new TestResponseCachingKeyProvider("BaseKey"));
80
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache, keyProvider: new TestResponseCachingKeyProvider("BaseKey"));
109
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache, keyProvider: new TestResponseCachingKeyProvider("BaseKey", "VaryKey"));
129
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache, keyProvider: new TestResponseCachingKeyProvider("BaseKey", new[] { "VaryKey", "VaryKey2" }));
157
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache, keyProvider: new TestResponseCachingKeyProvider("BaseKey"));
183
Assert.False(
ResponseCachingMiddleware
.ContentIsNotModified(context));
199
Assert.True(
ResponseCachingMiddleware
.ContentIsNotModified(context));
204
Assert.True(
ResponseCachingMiddleware
.ContentIsNotModified(context));
209
Assert.False(
ResponseCachingMiddleware
.ContentIsNotModified(context));
231
Assert.True(
ResponseCachingMiddleware
.ContentIsNotModified(context));
237
Assert.True(
ResponseCachingMiddleware
.ContentIsNotModified(context));
243
Assert.False(
ResponseCachingMiddleware
.ContentIsNotModified(context));
265
Assert.True(
ResponseCachingMiddleware
.ContentIsNotModified(context));
284
Assert.False(
ResponseCachingMiddleware
.ContentIsNotModified(context));
296
Assert.False(
ResponseCachingMiddleware
.ContentIsNotModified(context));
324
Assert.True(
ResponseCachingMiddleware
.ContentIsNotModified(context));
339
Assert.False(
ResponseCachingMiddleware
.ContentIsNotModified(context));
352
Assert.True(
ResponseCachingMiddleware
.ContentIsNotModified(context));
362
var
middleware = TestUtils.CreateTestMiddleware(options: new ResponseCachingOptions
378
var
middleware = TestUtils.CreateTestMiddleware(options: new ResponseCachingOptions
400
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, policyProvider: new ResponseCachingPolicyProvider());
420
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, policyProvider: new ResponseCachingPolicyProvider());
435
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink);
452
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, options: new ResponseCachingOptions
472
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, options: new ResponseCachingOptions
497
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, options: new ResponseCachingOptions
522
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache);
551
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache);
601
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache);
622
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink);
640
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink);
658
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink);
673
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink);
691
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache);
719
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache);
748
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache);
779
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache);
807
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache);
827
var
middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache);
848
var
middleware = TestUtils.CreateTestMiddleware(
882
ResponseCachingMiddleware
.AddResponseCachingFeature(httpContext);
885
Assert.ThrowsAny<InvalidOperationException>(() =>
ResponseCachingMiddleware
.AddResponseCachingFeature(httpContext));
906
var
middleware = TestUtils.CreateTestMiddleware(next: httpContext =>
931
var normalizedStrings =
ResponseCachingMiddleware
.GetOrderCasingNormalizedStringValues(lowercaseStrings);
942
var normalizedStrings =
ResponseCachingMiddleware
.GetOrderCasingNormalizedStringValues(reverseOrderStrings);
952
var normalizedStrings =
ResponseCachingMiddleware
.GetOrderCasingNormalizedStringValues(originalStrings);
TestUtils.cs (1)
189
internal static
ResponseCachingMiddleware
CreateTestMiddleware(