diff --git a/src/Microsoft.AspNetCore.ResponseCaching/Internal/LoggerExtensions.cs b/src/Microsoft.AspNetCore.ResponseCaching/Internal/LoggerExtensions.cs
new file mode 100644
index 0000000000..b90073179e
--- /dev/null
+++ b/src/Microsoft.AspNetCore.ResponseCaching/Internal/LoggerExtensions.cs
@@ -0,0 +1,300 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using Microsoft.Extensions.Logging;
+using Microsoft.Net.Http.Headers;
+
+namespace Microsoft.AspNetCore.ResponseCaching.Internal
+{
+ ///
+ /// Defines *all* the logger messages produced by response caching
+ ///
+ internal static class LoggerExtensions
+ {
+ private static Action _logRequestMethodNotCacheable;
+ private static Action _logRequestWithAuthorizationNotCacheable;
+ private static Action _logRequestWithNoCacheNotCacheable;
+ private static Action _logRequestWithPragmaNoCacheNotCacheable;
+ private static Action _logExpirationMinFreshAdded;
+ private static Action _logExpirationSharedMaxAgeExceeded;
+ private static Action _logExpirationMustRevalidate;
+ private static Action _logExpirationMaxStaleSatisfied;
+ private static Action _logExpirationMaxAgeExceeded;
+ private static Action _logExpirationExpiresExceeded;
+ private static Action _logResponseWithoutPublicNotCacheable;
+ private static Action _logResponseWithNoStoreNotCacheable;
+ private static Action _logResponseWithNoCacheNotCacheable;
+ private static Action _logResponseWithSetCookieNotCacheable;
+ private static Action _logResponseWithVaryStarNotCacheable;
+ private static Action _logResponseWithPrivateNotCacheable;
+ private static Action _logResponseWithUnsuccessfulStatusCodeNotCacheable;
+ private static Action _logNotModifiedIfNoneMatchStar;
+ private static Action _logNotModifiedIfNoneMatchMatched;
+ private static Action _logNotModifiedIfUnmodifiedSinceSatisfied;
+ private static Action _logNotModifiedServed;
+ private static Action _logCachedResponseServed;
+ private static Action _logGatewayTimeoutServed;
+ private static Action _logNoResponseServed;
+ private static Action _logVaryByRulesUpdated;
+ private static Action _logResponseCached;
+ private static Action _logResponseNotCached;
+ private static Action _logResponseContentLengthMismatchNotCached;
+
+ static LoggerExtensions()
+ {
+ _logRequestMethodNotCacheable = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 1,
+ formatString: "The request cannot be served from cache because it uses the HTTP method: {Method}.");
+ _logRequestWithAuthorizationNotCacheable = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 2,
+ formatString: $"The request cannot be served from cache because it contains an '{HeaderNames.Authorization}' header.");
+ _logRequestWithNoCacheNotCacheable = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 3,
+ formatString: "The request cannot be served from cache because it contains a 'no-cache' cache directive.");
+ _logRequestWithPragmaNoCacheNotCacheable = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 4,
+ formatString: "The request cannot be served from cache because it contains a 'no-cache' pragma directive.");
+ _logExpirationMinFreshAdded = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 5,
+ formatString: "Adding a minimum freshness requirement of {Duration} specified by the 'min-fresh' cache directive.");
+ _logExpirationSharedMaxAgeExceeded = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 6,
+ formatString: "The age of the entry is {Age} and has exceeded the maximum age for shared caches of {SharedMaxAge} specified by the 's-maxage' cache directive.");
+ _logExpirationMustRevalidate = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 7,
+ formatString: "The age of the entry is {Age} and has exceeded the maximum age of {MaxAge} specified by the 'max-age' cache directive. It must be revalidated because the 'must-revalidate' cache directive is specified.");
+ _logExpirationMaxStaleSatisfied = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 8,
+ formatString: "The age of the entry is {Age} and has exceeded the maximum age of {MaxAge} specified by the 'max-age' cache directive. However, it satisfied the maximum stale allowance of {MaxStale} specified by the 'max-stale' cache directive.");
+ _logExpirationMaxAgeExceeded = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 9,
+ formatString: "The age of the entry is {Age} and has exceeded the maximum age of {MaxAge} specified by the 'max-age' cache directive.");
+ _logExpirationExpiresExceeded = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 10,
+ formatString: $"The response time of the entry is {{ResponseTime}} and has exceeded the expiry date of {{Expired}} specified by the '{HeaderNames.Expires}' header.");
+ _logResponseWithoutPublicNotCacheable = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 11,
+ formatString: "Response is not cacheable because it does not contain the 'public' cache directive.");
+ _logResponseWithNoStoreNotCacheable = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 12,
+ formatString: "Response is not cacheable because it or its corresponding request contains a 'no-store' cache directive.");
+ _logResponseWithNoCacheNotCacheable = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 13,
+ formatString: "Response is not cacheable because it contains a 'no-cache' cache directive.");
+ _logResponseWithSetCookieNotCacheable = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 14,
+ formatString: $"Response is not cacheable because it contains a '{HeaderNames.SetCookie}' header.");
+ _logResponseWithVaryStarNotCacheable = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 15,
+ formatString: $"Response is not cacheable because it contains a '{HeaderNames.Vary}' header with a value of *.");
+ _logResponseWithPrivateNotCacheable = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 16,
+ formatString: "Response is not cacheable because it contains the 'private' cache directive.");
+ _logResponseWithUnsuccessfulStatusCodeNotCacheable = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 17,
+ formatString: "Response is not cacheable because its status code {StatusCode} does not indicate success.");
+ _logNotModifiedIfNoneMatchStar = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 18,
+ formatString: $"The '{HeaderNames.IfNoneMatch}' header of the request contains a value of *.");
+ _logNotModifiedIfNoneMatchMatched = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 19,
+ formatString: $"The ETag {{ETag}} in the '{HeaderNames.IfNoneMatch}' header matched the ETag of a cached entry.");
+ _logNotModifiedIfUnmodifiedSinceSatisfied = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 20,
+ formatString: $"The last modified date of {{LastModified}} is before the date {{IfUnmodifiedSince}} specified in the '{HeaderNames.IfUnmodifiedSince}' header.");
+ _logNotModifiedServed = LoggerMessage.Define(
+ logLevel: LogLevel.Information,
+ eventId: 21,
+ formatString: "The content requested has not been modified.");
+ _logCachedResponseServed = LoggerMessage.Define(
+ logLevel: LogLevel.Information,
+ eventId: 22,
+ formatString: "Serving response from cache.");
+ _logGatewayTimeoutServed = LoggerMessage.Define(
+ logLevel: LogLevel.Information,
+ eventId: 23,
+ formatString: "No cached response available for this request and the 'only-if-cached' cache directive was specified.");
+ _logNoResponseServed = LoggerMessage.Define(
+ logLevel: LogLevel.Information,
+ eventId: 24,
+ formatString: "No cached response available for this request.");
+ _logVaryByRulesUpdated = LoggerMessage.Define(
+ logLevel: LogLevel.Debug,
+ eventId: 25,
+ formatString: "Vary by rules were updated. Headers: {Headers}, Query keys: {QueryKeys}");
+ _logResponseCached = LoggerMessage.Define(
+ logLevel: LogLevel.Information,
+ eventId: 26,
+ formatString: "The response has been cached.");
+ _logResponseNotCached = LoggerMessage.Define(
+ logLevel: LogLevel.Information,
+ eventId: 27,
+ formatString: "The response could not be cached for this request.");
+ _logResponseContentLengthMismatchNotCached = LoggerMessage.Define(
+ logLevel: LogLevel.Warning,
+ eventId: 28,
+ formatString: $"The response could not be cached for this request because the '{HeaderNames.ContentLength}' did not match the body length.");
+ }
+
+ internal static void LogRequestMethodNotCacheable(this ILogger logger, string method)
+ {
+ _logRequestMethodNotCacheable(logger, method, null);
+ }
+
+ internal static void LogRequestWithAuthorizationNotCacheable(this ILogger logger)
+ {
+ _logRequestWithAuthorizationNotCacheable(logger, null);
+ }
+
+ internal static void LogRequestWithNoCacheNotCacheable(this ILogger logger)
+ {
+ _logRequestWithNoCacheNotCacheable(logger, null);
+ }
+
+ internal static void LogRequestWithPragmaNoCacheNotCacheable(this ILogger logger)
+ {
+ _logRequestWithPragmaNoCacheNotCacheable(logger, null);
+ }
+
+ internal static void LogExpirationMinFreshAdded(this ILogger logger, TimeSpan duration)
+ {
+ _logExpirationMinFreshAdded(logger, duration, null);
+ }
+
+ internal static void LogExpirationSharedMaxAgeExceeded(this ILogger logger, TimeSpan age, TimeSpan sharedMaxAge)
+ {
+ _logExpirationSharedMaxAgeExceeded(logger, age, sharedMaxAge, null);
+ }
+
+ internal static void LogExpirationMustRevalidate(this ILogger logger, TimeSpan age, TimeSpan maxAge)
+ {
+ _logExpirationMustRevalidate(logger, age, maxAge, null);
+ }
+
+ internal static void LogExpirationMaxStaleSatisfied(this ILogger logger, TimeSpan age, TimeSpan maxAge, TimeSpan maxStale)
+ {
+ _logExpirationMaxStaleSatisfied(logger, age, maxAge, maxStale, null);
+ }
+
+ internal static void LogExpirationMaxAgeExceeded(this ILogger logger, TimeSpan age, TimeSpan sharedMaxAge)
+ {
+ _logExpirationMaxAgeExceeded(logger, age, sharedMaxAge, null);
+ }
+
+ internal static void LogExpirationExpiresExceeded(this ILogger logger, DateTimeOffset responseTime, DateTimeOffset expires)
+ {
+ _logExpirationExpiresExceeded(logger, responseTime, expires, null);
+ }
+
+ internal static void LogResponseWithoutPublicNotCacheable(this ILogger logger)
+ {
+ _logResponseWithoutPublicNotCacheable(logger, null);
+ }
+
+ internal static void LogResponseWithNoStoreNotCacheable(this ILogger logger)
+ {
+ _logResponseWithNoStoreNotCacheable(logger, null);
+ }
+
+ internal static void LogResponseWithNoCacheNotCacheable(this ILogger logger)
+ {
+ _logResponseWithNoCacheNotCacheable(logger, null);
+ }
+
+ internal static void LogResponseWithSetCookieNotCacheable(this ILogger logger)
+ {
+ _logResponseWithSetCookieNotCacheable(logger, null);
+ }
+
+ internal static void LogResponseWithVaryStarNotCacheable(this ILogger logger)
+ {
+ _logResponseWithVaryStarNotCacheable(logger, null);
+ }
+
+ internal static void LogResponseWithPrivateNotCacheable(this ILogger logger)
+ {
+ _logResponseWithPrivateNotCacheable(logger, null);
+ }
+
+ internal static void LogResponseWithUnsuccessfulStatusCodeNotCacheable(this ILogger logger, int statusCode)
+ {
+ _logResponseWithUnsuccessfulStatusCodeNotCacheable(logger, statusCode, null);
+ }
+
+ internal static void LogNotModifiedIfNoneMatchStar(this ILogger logger)
+ {
+ _logNotModifiedIfNoneMatchStar(logger, null);
+ }
+
+ internal static void LogNotModifiedIfNoneMatchMatched(this ILogger logger, EntityTagHeaderValue etag)
+ {
+ _logNotModifiedIfNoneMatchMatched(logger, etag, null);
+ }
+
+ internal static void LogNotModifiedIfUnmodifiedSinceSatisfied(this ILogger logger, DateTimeOffset lastModified, DateTimeOffset ifUnmodifiedSince)
+ {
+ _logNotModifiedIfUnmodifiedSinceSatisfied(logger, lastModified, ifUnmodifiedSince, null);
+ }
+
+ internal static void LogNotModifiedServed(this ILogger logger)
+ {
+ _logNotModifiedServed(logger, null);
+ }
+
+ internal static void LogCachedResponseServed(this ILogger logger)
+ {
+ _logCachedResponseServed(logger, null);
+ }
+
+ internal static void LogGatewayTimeoutServed(this ILogger logger)
+ {
+ _logGatewayTimeoutServed(logger, null);
+ }
+
+ internal static void LogNoResponseServed(this ILogger logger)
+ {
+ _logNoResponseServed(logger, null);
+ }
+
+ internal static void LogVaryByRulesUpdated(this ILogger logger, string headers, string queryKeys)
+ {
+ _logVaryByRulesUpdated(logger, headers, queryKeys, null);
+ }
+
+ internal static void LogResponseCached(this ILogger logger)
+ {
+ _logResponseCached(logger, null);
+ }
+
+ internal static void LogResponseNotCached(this ILogger logger)
+ {
+ _logResponseNotCached(logger, null);
+ }
+
+ internal static void LogResponseContentLengthMismatchNotCached(this ILogger logger)
+ {
+ _logResponseContentLengthMismatchNotCached(logger, null);
+ }
+ }
+}
diff --git a/src/Microsoft.AspNetCore.ResponseCaching/Internal/ResponseCacheContext.cs b/src/Microsoft.AspNetCore.ResponseCaching/Internal/ResponseCacheContext.cs
index c11ff159f3..5d0f4cc17c 100644
--- a/src/Microsoft.AspNetCore.ResponseCaching/Internal/ResponseCacheContext.cs
+++ b/src/Microsoft.AspNetCore.ResponseCaching/Internal/ResponseCacheContext.cs
@@ -6,6 +6,7 @@ using System.IO;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Headers;
+using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.ResponseCaching.Internal
@@ -23,10 +24,10 @@ namespace Microsoft.AspNetCore.ResponseCaching.Internal
private DateTimeOffset? _responseExpires;
private bool _parsedResponseExpires;
- internal ResponseCacheContext(
- HttpContext httpContext)
+ internal ResponseCacheContext(HttpContext httpContext, ILogger logger)
{
HttpContext = httpContext;
+ Logger = logger;
}
public HttpContext HttpContext { get; }
@@ -37,6 +38,8 @@ namespace Microsoft.AspNetCore.ResponseCaching.Internal
public CachedVaryByRules CachedVaryByRules { get; internal set; }
+ internal ILogger Logger { get; }
+
internal bool ShouldCacheResponse { get; set; }
internal string BaseKey { get; set; }
diff --git a/src/Microsoft.AspNetCore.ResponseCaching/Internal/ResponseCachePolicyProvider.cs b/src/Microsoft.AspNetCore.ResponseCaching/Internal/ResponseCachePolicyProvider.cs
index ab331ff311..cc7f174a07 100644
--- a/src/Microsoft.AspNetCore.ResponseCaching/Internal/ResponseCachePolicyProvider.cs
+++ b/src/Microsoft.AspNetCore.ResponseCaching/Internal/ResponseCachePolicyProvider.cs
@@ -18,12 +18,14 @@ namespace Microsoft.AspNetCore.ResponseCaching.Internal
var request = context.HttpContext.Request;
if (!HttpMethods.IsGet(request.Method) && !HttpMethods.IsHead(request.Method))
{
+ context.Logger.LogRequestMethodNotCacheable(request.Method);
return false;
}
// Verify existence of authorization headers
if (!StringValues.IsNullOrEmpty(request.Headers[HeaderNames.Authorization]))
{
+ context.Logger.LogRequestWithAuthorizationNotCacheable();
return false;
}
@@ -32,6 +34,7 @@ namespace Microsoft.AspNetCore.ResponseCaching.Internal
{
if (context.RequestCacheControlHeaderValue.NoCache)
{
+ context.Logger.LogRequestWithNoCacheNotCacheable();
return false;
}
}
@@ -43,6 +46,7 @@ namespace Microsoft.AspNetCore.ResponseCaching.Internal
{
if (string.Equals("no-cache", directive, StringComparison.OrdinalIgnoreCase))
{
+ context.Logger.LogRequestWithPragmaNoCacheNotCacheable();
return false;
}
}
@@ -56,18 +60,21 @@ namespace Microsoft.AspNetCore.ResponseCaching.Internal
// Only cache pages explicitly marked with public
if (!context.ResponseCacheControlHeaderValue.Public)
{
+ context.Logger.LogResponseWithoutPublicNotCacheable();
return false;
}
// Check no-store
if (context.RequestCacheControlHeaderValue.NoStore || context.ResponseCacheControlHeaderValue.NoStore)
{
+ context.Logger.LogResponseWithNoStoreNotCacheable();
return false;
}
// Check no-cache
if (context.ResponseCacheControlHeaderValue.NoCache)
{
+ context.Logger.LogResponseWithNoCacheNotCacheable();
return false;
}
@@ -76,6 +83,7 @@ namespace Microsoft.AspNetCore.ResponseCaching.Internal
// Do not cache responses with Set-Cookie headers
if (!StringValues.IsNullOrEmpty(response.Headers[HeaderNames.SetCookie]))
{
+ context.Logger.LogResponseWithSetCookieNotCacheable();
return false;
}
@@ -83,18 +91,21 @@ namespace Microsoft.AspNetCore.ResponseCaching.Internal
var varyHeader = response.Headers[HeaderNames.Vary];
if (varyHeader.Count == 1 && string.Equals(varyHeader, "*", StringComparison.OrdinalIgnoreCase))
{
+ context.Logger.LogResponseWithVaryStarNotCacheable();
return false;
}
// Check private
if (context.ResponseCacheControlHeaderValue.Private)
{
+ context.Logger.LogResponseWithPrivateNotCacheable();
return false;
}
// Check response code
if (response.StatusCode != StatusCodes.Status200OK)
{
+ context.Logger.LogResponseWithUnsuccessfulStatusCodeNotCacheable(response.StatusCode);
return false;
}
@@ -105,6 +116,7 @@ namespace Microsoft.AspNetCore.ResponseCaching.Internal
!context.ResponseCacheControlHeaderValue.MaxAge.HasValue &&
context.ResponseTime.Value >= context.ResponseExpires)
{
+ context.Logger.LogExpirationExpiresExceeded(context.ResponseTime.Value, context.ResponseExpires.Value);
return false;
}
}
@@ -113,22 +125,27 @@ namespace Microsoft.AspNetCore.ResponseCaching.Internal
var age = context.ResponseTime.Value - context.ResponseDate.Value;
// Validate shared max age
- if (age >= context.ResponseCacheControlHeaderValue.SharedMaxAge)
+ var sharedMaxAge = context.ResponseCacheControlHeaderValue.SharedMaxAge;
+ if (age >= sharedMaxAge)
{
+ context.Logger.LogExpirationSharedMaxAgeExceeded(age, sharedMaxAge.Value);
return false;
}
- else if (!context.ResponseCacheControlHeaderValue.SharedMaxAge.HasValue)
+ else if (!sharedMaxAge.HasValue)
{
// Validate max age
- if (age >= context.ResponseCacheControlHeaderValue.MaxAge)
+ var maxAge = context.ResponseCacheControlHeaderValue.MaxAge;
+ if (age >= maxAge)
{
+ context.Logger.LogExpirationMaxAgeExceeded(age, maxAge.Value);
return false;
}
- else if (!context.ResponseCacheControlHeaderValue.MaxAge.HasValue)
+ else if (!maxAge.HasValue)
{
// Validate expiration
if (context.ResponseTime.Value >= context.ResponseExpires)
{
+ context.Logger.LogExpirationExpiresExceeded(context.ResponseTime.Value, context.ResponseExpires.Value);
return false;
}
}
@@ -144,41 +161,55 @@ namespace Microsoft.AspNetCore.ResponseCaching.Internal
var cachedControlHeaders = context.CachedResponseHeaders.CacheControl ?? EmptyCacheControl;
// Add min-fresh requirements
- if (context.RequestCacheControlHeaderValue.MinFresh.HasValue)
+ var minFresh = context.RequestCacheControlHeaderValue.MinFresh;
+ if (minFresh.HasValue)
{
- age += context.RequestCacheControlHeaderValue.MinFresh.Value;
+ age += minFresh.Value;
+ context.Logger.LogExpirationMinFreshAdded(minFresh.Value);
}
// Validate shared max age, this overrides any max age settings for shared caches
- if (age >= cachedControlHeaders.SharedMaxAge)
+ var sharedMaxAge = cachedControlHeaders.SharedMaxAge;
+ if (age >= sharedMaxAge)
{
// shared max age implies must revalidate
+ context.Logger.LogExpirationSharedMaxAgeExceeded(age, sharedMaxAge.Value);
return false;
}
- else if (!cachedControlHeaders.SharedMaxAge.HasValue)
+ else if (!sharedMaxAge.HasValue)
{
+ var cachedMaxAge = cachedControlHeaders.MaxAge;
+ var requestMaxAge = context.RequestCacheControlHeaderValue.MaxAge;
+ var lowestMaxAge = cachedMaxAge < requestMaxAge ? cachedMaxAge : requestMaxAge ?? cachedMaxAge;
// Validate max age
- if (age >= cachedControlHeaders.MaxAge || age >= context.RequestCacheControlHeaderValue.MaxAge)
+ if (age >= lowestMaxAge)
{
// Must revalidate
if (cachedControlHeaders.MustRevalidate)
{
+ context.Logger.LogExpirationMustRevalidate(age, lowestMaxAge.Value);
return false;
}
// Request allows stale values
- if (age < context.RequestCacheControlHeaderValue.MaxStaleLimit)
+ var maxStaleLimit = context.RequestCacheControlHeaderValue.MaxStaleLimit;
+ if (maxStaleLimit.HasValue && age - lowestMaxAge < maxStaleLimit)
{
+ context.Logger.LogExpirationMaxStaleSatisfied(age, lowestMaxAge.Value, maxStaleLimit.Value);
return true;
}
+ context.Logger.LogExpirationMaxAgeExceeded(age, lowestMaxAge.Value);
return false;
}
- else if (!cachedControlHeaders.MaxAge.HasValue && !context.RequestCacheControlHeaderValue.MaxAge.HasValue)
+ else if (!cachedMaxAge.HasValue && !requestMaxAge.HasValue)
{
// Validate expiration
- if (context.ResponseTime.Value >= context.CachedResponseHeaders.Expires)
+ var responseTime = context.ResponseTime.Value;
+ var expires = context.CachedResponseHeaders.Expires;
+ if (responseTime >= expires)
{
+ context.Logger.LogExpirationExpiresExceeded(responseTime, expires.Value);
return false;
}
}
diff --git a/src/Microsoft.AspNetCore.ResponseCaching/ResponseCacheMiddleware.cs b/src/Microsoft.AspNetCore.ResponseCaching/ResponseCacheMiddleware.cs
index 425a291db5..c7939b82c8 100644
--- a/src/Microsoft.AspNetCore.ResponseCaching/ResponseCacheMiddleware.cs
+++ b/src/Microsoft.AspNetCore.ResponseCaching/ResponseCacheMiddleware.cs
@@ -10,7 +10,7 @@ using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Headers;
using Microsoft.AspNetCore.ResponseCaching.Internal;
using Microsoft.Extensions.Internal;
-using Microsoft.Extensions.ObjectPool;
+using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Primitives;
using Microsoft.Net.Http.Headers;
@@ -22,15 +22,17 @@ namespace Microsoft.AspNetCore.ResponseCaching
private static readonly TimeSpan DefaultExpirationTimeSpan = TimeSpan.FromSeconds(10);
private readonly RequestDelegate _next;
- private readonly IResponseCacheStore _store;
private readonly ResponseCacheOptions _options;
+ private readonly ILogger _logger;
private readonly IResponseCachePolicyProvider _policyProvider;
+ private readonly IResponseCacheStore _store;
private readonly IResponseCacheKeyProvider _keyProvider;
private readonly Func