1 write to HttpContext
Microsoft.AspNetCore.OutputCaching (1)
OutputCacheMiddleware.cs (1)
94
var context = new OutputCacheContext {
HttpContext
= httpContext };
35 references to HttpContext
Microsoft.AspNetCore.OutputCaching (35)
OutputCacheContext.cs (1)
41
/// Gets the <see cref="
HttpContext
"/>.
OutputCacheKeyProvider.cs (6)
96
var request = context.
HttpContext
.Request;
160
var requestHeaders = context.
HttpContext
.Request.Headers;
197
if (varyQueryKeys.Count == 1 && string.Equals(varyQueryKeys[0], "*", StringComparison.Ordinal) && context.
HttpContext
.Request.Query.Count > 0)
200
var queryArray = context.
HttpContext
.Request.Query.ToArray();
240
var queryKeyValues = context.
HttpContext
.Request.Query[queryKey];
286
var routeValueValue = context.
HttpContext
.Request.RouteValues[routeValueName];
OutputCacheMiddleware.cs (21)
267
await policy.ServeFromCacheAsync(context, context.
HttpContext
.RequestAborted);
286
context.
HttpContext
.Response.StatusCode = StatusCodes.Status304NotModified;
292
context.
HttpContext
.Response.Headers[key] = values;
298
var response = context.
HttpContext
.Response;
316
await context.CachedResponse.CopyToAsync(response.BodyWriter, context.
HttpContext
.RequestAborted);
320
context.
HttpContext
.Abort();
346
cacheEntry = await _outputCacheEntryDispatcher.ScheduleAsync(cacheContext.CacheKey, (Store: _store, CacheContext: cacheContext), static async (key, state) => await OutputCacheEntryFormatter.GetAsync(key, state.Store, state.CacheContext.
HttpContext
.RequestAborted));
364
if (HeaderUtilities.ContainsCacheDirective(cacheContext.
HttpContext
.Request.Headers.CacheControl, CacheControlHeaderValue.OnlyIfCachedString))
367
cacheContext.
HttpContext
.Response.StatusCode = StatusCodes.Status504GatewayTimeout;
394
var response = context.
HttpContext
.Response;
424
var contentLength = context.
HttpContext
.Response.ContentLength;
429
&& HttpMethods.IsHead(context.
HttpContext
.Request.Method)))
443
_store, _logger, context.
HttpContext
.RequestAborted);
484
if (context.
HttpContext
.Features.Get<IOutputCacheFeature>() != null)
489
context.
HttpContext
.Features.Set<IOutputCacheFeature>(new OutputCacheFeature(context));
495
context.OriginalResponseStream = context.
HttpContext
.Response.Body;
501
context.
HttpContext
.Response.Body = context.OutputCacheStream;
510
context.
HttpContext
.Response.Body = context.OriginalResponseStream;
513
RemoveOutputCacheFeature(context.
HttpContext
);
519
var ifNoneMatchHeader = context.
HttpContext
.Request.Headers.IfNoneMatch;
552
var ifModifiedSince = context.
HttpContext
.Request.Headers.IfModifiedSince;
OutputCachePolicyBuilder.cs (1)
336
if (!await r(c, c.
HttpContext
.RequestAborted))
Policies\DefaultPolicy.cs (2)
44
var response = context.
HttpContext
.Response;
67
var request = context.
HttpContext
.Request;
Policies\NamedPolicy.cs (1)
72
_options ??= context.
HttpContext
.RequestServices.GetRequiredService<IOptions<OutputCacheOptions>>();
Policies\SetCacheKeyPrefixPolicy.cs (1)
26
return _varyByAsync.Invoke(context.
HttpContext
, context.CacheVaryByRules, cancellationToken);
Policies\TypedPolicy.cs (1)
33
var options = context.
HttpContext
.RequestServices.GetRequiredService<IOptions<OutputCacheOptions>>();
Policies\VaryByValuePolicy.cs (1)
30
return _varyByAsync.Invoke(context.
HttpContext
, context.CacheVaryByRules, cancellationToken);