Add XML Documentation to ResponseCachingMiddleware and ResponseCachingExtensions (#18968)

* Add XML Documentation to ResponseCachingMiddleware and ResponseCachingExtensions

* Update src/Middleware/ResponseCaching/src/ResponseCachingExtensions.cs

Co-Authored-By: Andrew Stanton-Nurse <andrew@stanton-nurse.com>

* Update src/Middleware/ResponseCaching/src/ResponseCachingExtensions.cs

Co-Authored-By: Andrew Stanton-Nurse <andrew@stanton-nurse.com>

* Update src/Middleware/ResponseCaching/src/ResponseCachingExtensions.cs

Co-Authored-By: Andrew Stanton-Nurse <andrew@stanton-nurse.com>

* Update src/Middleware/ResponseCaching/src/ResponseCachingMiddleware.cs

Co-Authored-By: Andrew Stanton-Nurse <andrew@stanton-nurse.com>

* Update src/Middleware/ResponseCaching/src/ResponseCachingMiddleware.cs

Co-Authored-By: Andrew Stanton-Nurse <andrew@stanton-nurse.com>

* Update ResponseCachingMiddleware.cs

Co-authored-by: Andrew Stanton-Nurse <andrew@stanton-nurse.com>
This commit is contained in:
Roman Marusyk 2020-02-19 23:39:24 +02:00 committed by GitHub
parent e3a5f03e24
commit 76d197f0dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -6,8 +6,15 @@ using Microsoft.AspNetCore.ResponseCaching;
namespace Microsoft.AspNetCore.Builder
{
/// <summary>
/// Extension methods for adding the <see cref="ResponseCachingMiddleware"/> to an application.
/// </summary>
public static class ResponseCachingExtensions
{
/// <summary>
/// Adds the <see cref="ResponseCachingMiddleware"/> for caching HTTP responses.
/// </summary>
/// <param name="app">The <see cref="IApplicationBuilder"/>.</param>
public static IApplicationBuilder UseResponseCaching(this IApplicationBuilder app)
{
if (app == null)

View File

@ -14,6 +14,9 @@ using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.ResponseCaching
{
/// <summary>
/// Enable HTTP response caching.
/// </summary>
public class ResponseCachingMiddleware
{
private static readonly TimeSpan DefaultExpirationTimeSpan = TimeSpan.FromSeconds(10);
@ -29,6 +32,13 @@ namespace Microsoft.AspNetCore.ResponseCaching
private readonly IResponseCache _cache;
private readonly IResponseCachingKeyProvider _keyProvider;
/// <summary>
/// Creates a new <see cref="ResponseCachingMiddleware"/>.
/// </summary>
/// <param name="next">The <see cref="RequestDelegate"/> representing the next middleware in the pipeline.</param>
/// <param name="options">The options for this middleware.</param>
/// <param name="loggerFactory">The <see cref="ILoggerFactory"/> used for logging.</param>
/// <param name="poolProvider">The <see cref="ObjectPoolProvider"/> used for creating <see cref="ObjectPool"/> instances.</param>
public ResponseCachingMiddleware(
RequestDelegate next,
IOptions<ResponseCachingOptions> options,
@ -88,6 +98,11 @@ namespace Microsoft.AspNetCore.ResponseCaching
_keyProvider = keyProvider;
}
/// <summary>
/// Invokes the logic of the middleware.
/// </summary>
/// <param name="httpContext">The <see cref="HttpContext"/>.</param>
/// <returns>A <see cref="Task"/> that completes when the middleware has completed processing.</returns>
public async Task Invoke(HttpContext httpContext)
{
var context = new ResponseCachingContext(httpContext, _logger);