3 instantiations of OutputCacheContext
Microsoft.AspNetCore.OutputCaching (1)
OutputCacheMiddleware.cs (1)
101
var context = new
OutputCacheContext
{ HttpContext = httpContext };
Microsoft.AspNetCore.OutputCaching.Tests (2)
TestUtils.cs (2)
240
return new
OutputCacheContext
()
262
return new
OutputCacheContext
()
251 references to OutputCacheContext
Microsoft.AspNetCore.OutputCaching (94)
IOutputCacheFeature.cs (1)
14
OutputCacheContext
Context { get; }
IOutputCacheKeyProvider.cs (2)
11
/// <param name="context">The <see cref="
OutputCacheContext
"/>.</param>
13
string CreateStorageKey(
OutputCacheContext
context);
IOutputCachePolicy.cs (6)
12
/// Updates the <see cref="
OutputCacheContext
"/> before the cache middleware is invoked.
17
ValueTask CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellation);
20
/// Updates the <see cref="
OutputCacheContext
"/> before the cached response is used.
25
ValueTask ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellation);
28
/// Updates the <see cref="
OutputCacheContext
"/> before the response is served and can be cached.
33
ValueTask ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellation);
OutputCacheContext.cs (1)
14
/// Constructs a new instance of <see cref="
OutputCacheContext
"/>.
OutputCacheFeature.cs (2)
8
public OutputCacheFeature(
OutputCacheContext
context)
13
public
OutputCacheContext
Context { get; }
OutputCacheKeyProvider.cs (6)
38
public string CreateStorageKey(
OutputCacheContext
context)
74
public static bool TryAppendKeyPrefix(
OutputCacheContext
context, StringBuilder builder)
94
public bool TryAppendBaseKey(
OutputCacheContext
context, StringBuilder builder)
136
public bool TryAppendVaryByKey(
OutputCacheContext
context, StringBuilder builder)
142
throw new InvalidOperationException($"{nameof(
OutputCacheContext
.CacheVaryByRules)} must not be null on the {nameof(
OutputCacheContext
)}");
OutputCacheMiddleware.cs (12)
101
var
context = new OutputCacheContext { HttpContext = httpContext };
261
internal async Task<bool> TryServeCachedResponseAsync(
OutputCacheContext
context, OutputCacheEntry? cacheEntry, IReadOnlyList<IOutputCachePolicy> policies)
331
internal async Task<bool> TryServeFromCacheAsync(
OutputCacheContext
cacheContext, IReadOnlyList<IOutputCachePolicy> policies)
376
internal void CreateCacheKey(
OutputCacheContext
context)
390
internal void FinalizeCacheHeaders(
OutputCacheContext
context)
417
internal async ValueTask FinalizeCacheBodyAsync(
OutputCacheContext
context)
463
private bool OnStartResponse(
OutputCacheContext
context)
475
internal void StartResponse(
OutputCacheContext
context)
483
internal static void AddOutputCacheFeature(
OutputCacheContext
context)
493
internal void ShimResponseStream(
OutputCacheContext
context)
508
internal static void UnshimResponseStream(
OutputCacheContext
context)
517
internal bool ContentIsNotModified(
OutputCacheContext
context)
OutputCachePolicyBuilder.cs (3)
20
private List<Func<
OutputCacheContext
, CancellationToken, ValueTask<bool>>>? _requirements;
64
public OutputCachePolicyBuilder With(Func<
OutputCacheContext
, CancellationToken, ValueTask<bool>> predicate)
78
public OutputCachePolicyBuilder With(Func<
OutputCacheContext
, bool> predicate)
Policies\CompositePolicy.cs (3)
23
async ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
32
async ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
41
async ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
Policies\DefaultPolicy.cs (4)
21
ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
36
ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
42
ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
63
private static bool AttemptOutputCaching(
OutputCacheContext
context)
Policies\EmptyPolicy.cs (3)
18
ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
24
ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
30
ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
Policies\EnableCachePolicy.cs (3)
19
ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
27
ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
33
ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
Policies\ExpirationPolicy.cs (3)
23
ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
31
ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
37
ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
Policies\LockingPolicy.cs (3)
29
ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
37
ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
43
ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
Policies\NamedPolicy.cs (4)
24
async ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
37
async ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
50
async ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
62
internal ValueTask<IOutputCachePolicy?> GetProfilePolicy(
OutputCacheContext
context)
Policies\NoLookupPolicy.cs (3)
18
ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
26
ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
32
ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
Policies\NoStorePolicy.cs (3)
18
ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
26
ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
32
ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
Policies\PredicatePolicy.cs (7)
13
private readonly Func<
OutputCacheContext
, ValueTask<bool>> _predicate;
21
public PredicatePolicy(Func<
OutputCacheContext
, ValueTask<bool>> asyncPredicate, IOutputCachePolicy policy)
28
ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
34
ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
40
ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
45
private ValueTask ExecuteAwaited(Func<IOutputCachePolicy,
OutputCacheContext
, CancellationToken, ValueTask> action, IOutputCachePolicy policy,
OutputCacheContext
context, CancellationToken cancellationToken)
Policies\SetCacheKeyPrefixPolicy.cs (3)
24
ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
30
ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
36
ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
Policies\TagsPolicy.cs (3)
23
ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
34
ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
40
ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
Policies\TypedPolicy.cs (4)
31
private IOutputCachePolicy? CreatePolicy(
OutputCacheContext
context)
38
ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
44
ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
50
ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
Policies\VaryByHeaderPolicy.cs (3)
39
ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
54
ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
60
ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
Policies\VaryByHostPolicy.cs (3)
25
ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
33
ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
39
ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
Policies\VaryByQueryPolicy.cs (3)
40
ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
62
ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
68
ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
Policies\VaryByRouteValuePolicy.cs (3)
39
ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
46
ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
52
ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
Policies\VaryByValuePolicy.cs (3)
28
ValueTask IOutputCachePolicy.CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
34
ValueTask IOutputCachePolicy.ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
40
ValueTask IOutputCachePolicy.ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
Microsoft.AspNetCore.OutputCaching.Tests (156)
OutputCacheAttributeTests.cs (9)
14
var
context = TestUtils.CreateUninitializedContext();
25
var
context = TestUtils.CreateUninitializedContext();
37
var
context = TestUtils.CreateUninitializedContext();
51
var
context = TestUtils.CreateUninitializedContext(options: options);
66
var
context = TestUtils.CreateUninitializedContext(options: options);
77
var
context = TestUtils.CreateUninitializedContext();
93
var
context = TestUtils.CreateUninitializedContext();
108
var
context = TestUtils.CreateUninitializedContext();
127
var
context = TestUtils.CreateUninitializedContext();
OutputCacheKeyProviderTests.cs (30)
19
var
context = TestUtils.CreateTestContext();
34
var
context = TestUtils.CreateTestContext();
54
var
context = TestUtils.CreateTestContext();
69
var
context = TestUtils.CreateTestContext();
79
var
context = TestUtils.CreateTestContext();
88
var
context = TestUtils.CreateTestContext();
98
var
context = TestUtils.CreateTestContext();
111
var
context = TestUtils.CreateTestContext();
132
var
context = TestUtils.CreateTestContext();
144
var
context = TestUtils.CreateTestContext();
157
var
context = TestUtils.CreateTestContext();
169
var
context = TestUtils.CreateTestContext();
182
var
context = TestUtils.CreateTestContext();
195
var
context = TestUtils.CreateTestContext();
208
var
context = TestUtils.CreateTestContext();
221
var
context = TestUtils.CreateTestContext();
236
var
context = TestUtils.CreateTestContext();
251
var
context = TestUtils.CreateTestContext();
266
var
context = TestUtils.CreateTestContext();
285
var
context = TestUtils.CreateTestContext();
297
var
context = TestUtils.CreateTestContext();
310
var
context = TestUtils.CreateTestContext();
322
var
context = TestUtils.CreateTestContext();
336
var
context = TestUtils.CreateTestContext();
350
var
context = TestUtils.CreateTestContext();
363
var
context = TestUtils.CreateTestContext();
376
var
context = TestUtils.CreateTestContext();
389
var
context = TestUtils.CreateTestContext();
403
var
context = TestUtils.CreateTestContext();
418
var
context = TestUtils.CreateTestContext();
OutputCacheMiddlewareTests.cs (47)
38
var
context = TestUtils.CreateTestContext(cache: cache);
58
var
context = TestUtils.CreateTestContext(cache: cache);
74
var
context = TestUtils.CreateTestContext(cache: cache);
102
var
context = TestUtils.CreateTestContext(cache: cache);
132
var
context = TestUtils.CreateTestContext(cache: cache);
161
var
context = TestUtils.CreateTestContext(testSink: sink);
174
var
context = TestUtils.CreateTestContext(testSink: sink);
213
var
context = TestUtils.CreateTestContext(testSink: sink);
255
var
context = TestUtils.CreateTestContext(testSink: sink);
276
var
context = TestUtils.CreateTestContext(testSink: sink);
294
var
context = TestUtils.CreateTestContext(testSink: sink);
323
var
context = TestUtils.CreateTestContext(testSink: sink);
340
var
context = TestUtils.CreateTestContext(testSink: sink);
355
var
context = TestUtils.CreateTestContext(testSink: sink);
375
var
context = TestUtils.CreateTestContext();
391
var
context = TestUtils.CreateTestContext();
410
var
context = TestUtils.CreateTestContext();
430
var
context = TestUtils.CreateTestContext();
453
var
context = TestUtils.CreateTestContext();
479
var
context = TestUtils.CreateTestContext();
503
var
context = TestUtils.CreateTestContext(cache: cache, options: options);
533
var
context = TestUtils.CreateTestContext(cache: cache, options: options);
567
var
context = TestUtils.CreateTestContext(cache: cache, options: options);
616
var
context = TestUtils.CreateTestContext(cache: cache);
635
var
context = TestUtils.CreateTestContext();
656
var
context = TestUtils.CreateTestContext();
674
var
context = TestUtils.CreateTestContext();
689
var
context = TestUtils.CreateTestContext();
704
var
context = TestUtils.CreateTestContext(cache: cache);
732
var
context = TestUtils.CreateTestContext(cache: cache);
761
var
context = TestUtils.CreateTestContext(cache: cache);
792
var
context = TestUtils.CreateTestContext(cache: cache);
817
var
context = TestUtils.CreateTestContext(cache: cache);
838
var
context = TestUtils.CreateTestContext(cache: cache);
864
var
context = TestUtils.CreateTestContext();
890
var
context = TestUtils.CreateTestContext(httpContext);
927
var
context1 = TestUtils.CreateTestContext();
931
var
context2 = TestUtils.CreateTestContext();
978
var
context1 = TestUtils.CreateTestContext();
983
var
context2 = TestUtils.CreateTestContext();
1041
var
context1 = TestUtils.CreateTestContext();
1045
var
context2 = TestUtils.CreateTestContext();
1064
var
context = TestUtils.CreateTestContext(cache: cache);
1088
public ValueTask CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellation)
1095
public ValueTask ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellation)
1100
public ValueTask ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellation)
1137
var
requestContext = TestUtils.CreateTestContext(cache: cache);
OutputCachePoliciesTests.cs (23)
14
var
context = TestUtils.CreateUninitializedContext();
25
var
context = TestUtils.CreateUninitializedContext();
36
var
context = TestUtils.CreateUninitializedContext();
47
var
context = TestUtils.CreateUninitializedContext();
58
var
context = TestUtils.CreateUninitializedContext();
70
var
context = TestUtils.CreateUninitializedContext();
82
var
context = TestUtils.CreateUninitializedContext();
93
var
context = TestUtils.CreateUninitializedContext();
104
var
context = TestUtils.CreateUninitializedContext();
115
var
context = TestUtils.CreateUninitializedContext();
126
var
context = TestUtils.CreateUninitializedContext();
141
var
context = TestUtils.CreateUninitializedContext();
154
var
context = TestUtils.CreateUninitializedContext(options: options);
172
var
context = TestUtils.CreateUninitializedContext();
185
var
context = TestUtils.CreateUninitializedContext();
197
var
context = TestUtils.CreateUninitializedContext();
210
var
context = TestUtils.CreateUninitializedContext();
223
var
context = TestUtils.CreateUninitializedContext();
235
var
context = TestUtils.CreateUninitializedContext();
248
var
context = TestUtils.CreateUninitializedContext();
261
var
context = TestUtils.CreateUninitializedContext();
274
var
context = TestUtils.CreateUninitializedContext();
287
var
context = TestUtils.CreateUninitializedContext();
OutputCachePolicyBuilderTests.cs (24)
32
var
context = TestUtils.CreateUninitializedContext();
46
var
context = TestUtils.CreateUninitializedContext();
63
var
context = TestUtils.CreateUninitializedContext(options: options);
81
var
context = TestUtils.CreateUninitializedContext(options: options);
94
var
context = TestUtils.CreateUninitializedContext();
106
var
context = TestUtils.CreateUninitializedContext();
123
var
context = TestUtils.CreateUninitializedContext();
139
var
context = TestUtils.CreateUninitializedContext();
159
var
context = TestUtils.CreateUninitializedContext();
179
var
context = TestUtils.CreateUninitializedContext();
199
var
context1 = TestUtils.CreateUninitializedContext();
200
var
context2 = TestUtils.CreateUninitializedContext();
201
var
context3 = TestUtils.CreateUninitializedContext();
219
var
context = TestUtils.CreateUninitializedContext();
239
var
context = TestUtils.CreateUninitializedContext();
253
var
context = TestUtils.CreateUninitializedContext();
265
var
context = TestUtils.CreateUninitializedContext();
277
var
context = TestUtils.CreateUninitializedContext();
289
var
context = TestUtils.CreateUninitializedContext();
304
var
context = TestUtils.CreateUninitializedContext();
316
var
context = TestUtils.CreateUninitializedContext();
337
var
context = TestUtils.CreateUninitializedContext(options: options);
355
var
context = TestUtils.CreateUninitializedContext(options: options);
373
var
context = TestUtils.CreateUninitializedContext(options: options);
OutputCachePolicyProviderTests.cs (17)
47
var
context = TestUtils.CreateTestContext(testSink: sink);
66
var
context = TestUtils.CreateTestContext(testSink: sink);
80
var
context = TestUtils.CreateTestContext(testSink: sink);
96
var
context = TestUtils.CreateTestContext(testSink: sink);
114
var
context = TestUtils.CreateTestContext(testSink: sink);
130
var
context = TestUtils.CreateTestContext(testSink: sink);
144
var
context = TestUtils.CreateTestContext(testSink: sink);
162
var
context = TestUtils.CreateTestContext(testSink: sink);
180
var
context = TestUtils.CreateTestContext(testSink: sink);
198
var
context = TestUtils.CreateTestContext(testSink: sink);
212
var
context = TestUtils.CreateTestContext(testSink: sink);
226
var
context = TestUtils.CreateTestContext(testSink: sink);
245
var
context = TestUtils.CreateTestContext(testSink: sink);
321
var
context = TestUtils.CreateTestContext(testSink: sink);
335
var
context = TestUtils.CreateTestContext(testSink: sink);
355
var
context = TestUtils.CreateTestContext(testSink: sink);
378
var
context = TestUtils.CreateTestContext(testSink: sink);
TestUtils.cs (6)
228
internal static
OutputCacheContext
CreateTestContext(HttpContext? httpContext = null, IOutputCacheStore? cache = null, OutputCacheOptions? options = null, ITestSink? testSink = null)
250
internal static
OutputCacheContext
CreateUninitializedContext(HttpContext? httpContext = null, IOutputCacheStore? cache = null, OutputCacheOptions? options = null, ITestSink? testSink = null)
329
public string CreateStorageKey(
OutputCacheContext
? context)
396
public ValueTask CacheRequestAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
403
public ValueTask ServeFromCacheAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
408
public ValueTask ServeResponseAsync(
OutputCacheContext
context, CancellationToken cancellationToken)
OutputCachingSample (1)
Startup.cs (1)
68
var
cacheContext = context.Features.Get<IOutputCacheFeature>()?.Context;