Skip to content

Api docs for ResponseCaching #26531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
4 commits merged into from
Oct 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</Description>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<IsAspNetCoreApp>true</IsAspNetCoreApp>
<NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore</PackageTags>
<IsPackable>false</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</Description>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<IsAspNetCoreApp>true</IsAspNetCoreApp>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;https;hsts</PackageTags>
<IsPackable>false</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<IsAspNetCoreApp>true</IsAspNetCoreApp>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
<PackageTags>aspnetcore;cache;caching</PackageTags>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>ASP.NET Core middleware for caching HTTP responses on the server.</Description>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<IsAspNetCoreApp>true</IsAspNetCoreApp>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;cache;caching</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@

namespace Microsoft.AspNetCore.ResponseCaching
{
/// Default implementation for <see cref="IResponseCachingFeature" />
public class ResponseCachingFeature : IResponseCachingFeature
{
private string[] _varyByQueryKeys;

/// <inheritdoc />
public string[] VaryByQueryKeys
{
get
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
// Copyright (c) .NET Foundation. All rights reserved.
// 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.ComponentModel;

namespace Microsoft.AspNetCore.ResponseCaching
{
/// <summary>
/// Options for configuring the <see cref="ResponseCachingMiddleware"/>.
/// </summary>
public class ResponseCachingOptions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • For the SizeLimit property below, do you think it's valuable to explain what happens once the limit is hit?
  • For MaximumBodySize should we add what happens if the limit is exceeded?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

{
/// <summary>
/// The size limit for the response cache middleware in bytes. The default is set to 100 MB.
/// When this limit is exceeded, no new responses will be cached until older entries are
/// evicted.
/// </summary>
public long SizeLimit { get; set; } = 100 * 1024 * 1024;

/// <summary>
/// The largest cacheable size for the response body in bytes. The default is set to 64 MB.
/// If the response body exceeds this limit, it will not be cached by the <see cref="ResponseCachingMiddleware"/>.
/// </summary>
public long MaximumBodySize { get; set; } = 64 * 1024 * 1024;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>ASP.NET Core static files middleware. Includes middleware for serving static files, directory browsing, and default files.</Description>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<IsAspNetCoreApp>true</IsAspNetCoreApp>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;staticfiles</PackageTags>
<IsPackable>false</IsPackable>
Expand Down