You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tell a reader of the output caching article that .NET 11 exposes IOutputCachePolicyProvider as the policy-resolution seam behind output caching. The article already explains built-in named policies, base policies, and custom IOutputCachePolicy implementations; this report closes the residual gap for dynamic policy providers that load policies from external configuration, databases, or tenant-specific sources.
Gaps this report closes:
The output caching article never names the new IOutputCachePolicyProvider interface or its two members.
The article doesn't explain that a custom provider can replace the default provider through dependency injection when named and base policies must be resolved dynamically.
✅ Coverage status summary
Legend: ✅ already documented · ✏️ update needed · 🟣 could not determine
#
Feature element from What's New
Status
Where
1
IOutputCachePolicyProvider is a new public output-caching policy provider interface
Applies to:CURRENT-ONLY Target moniker:>= aspnetcore-11.0 Earlier versions affected: None — IOutputCachePolicyProvider is in PublicAPI.Unshipped.txt for .NET 11, while IOutputCachePolicy and the OutputCacheOptions policy methods were already shipped.
Article
monikerRange
Moniker state
performance/caching/output.md
'>= aspnetcore-7.0'
State D — the insertion point after L77 sits inside the broader >= aspnetcore-8.0 body zone (L18–L262). Add the provider section by closing >= aspnetcore-8.0, opening >= aspnetcore-11.0, adding the content, closing it, and reopening >= aspnetcore-8.0. The included .NET 7 article (performance/caching/output/includes/output7.md) remains unchanged.
The article has no tab groups, so the moniker split carries no tab-nesting hazard. After the change, output.md should have 3 :::moniker range= openers and 3 :::moniker-end closers; the reopened >= aspnetcore-8.0 range must be copied exactly.
📋 Coverage gap summary
A developer reading performance/caching/output.md can learn how to define named policies and base policies in OutputCacheOptions, and can author custom IOutputCachePolicy classes. They can't learn the new .NET 11 seam that controls where those policies come from: IOutputCachePolicyProvider. That matters for the scenarios named in the release note — external configuration, databases, and tenant-specific policy rules — because those scenarios don't fit static AddPolicy calls in Program.cs.
Feature announced in What's New:
ASP.NET Core in .NET 11 provides the IOutputCachePolicyProvider interface for implementing custom output caching policy selection logic. By using this interface, apps can determine the default base caching policy, check for the existence of named policies, and support advanced scenarios where policies must be resolved dynamically. Examples include loading policies from external configuration sources, databases, or applying tenant-specific caching rules.
Product source confirms the new seam: AddOutputCache registers DefaultOutputCachePolicyProvider as IOutputCachePolicyProvider, the middleware asks the provider for base policies, and named policies resolve through the provider at request time.
Breaking change: No — new public interface with the existing options-based behavior preserved by the default provider.
✏️ 1. Update — performance/caching/output.md, split the moniker zone and insert after line 77
Applies to:>= aspnetcore-11.0 Location:Lines 73–79, immediately after the paragraph beginning "For Razor Pages apps" and before ## Work with the default output caching policy.
Before (lines 73–79):
For apps with controllers, apply the `[OutputCache]` attribute to the action method to select a policy:
:::code language="csharp" source="~/performance/caching/output/samples/9.x/OCControllers/Controllers/Expire20Controller.cs" id="snippet_selectpolicy":::
For Razor Pages apps, apply the attribute to the Razor page class.
## Work with the default output caching policy
After:
For apps with controllers, apply the `[OutputCache]` attribute to the action method to select a policy:
:::code language="csharp" source="~/performance/caching/output/samples/9.x/OCControllers/Controllers/Expire20Controller.cs" id="snippet_selectpolicy":::
For Razor Pages apps, apply the attribute to the Razor page class.
:::moniker-end
:::moniker range=">= aspnetcore-11.0"
### Resolve policies dynamically with `IOutputCachePolicyProvider`
In .NET 11 or later, implement <xref:Microsoft.AspNetCore.OutputCaching.IOutputCachePolicyProvider> when policy selection needs to come from a dynamic source, such as external configuration, a database, or tenant-specific rules. The provider supplies the base policies for a request and resolves named policies used by endpoint metadata:
```csharppublicsealedclassTenantOutputCachePolicyProvider : IOutputCachePolicyProvider
{
publicIReadOnlyList<IOutputCachePolicy> GetBasePolicies()
{
// Return the default policies to apply to every request.return [newTenantBasePolicy()];
}
publicValueTask<IOutputCachePolicy?> GetPolicyAsync(stringpolicyName)
{
// Resolve named policies dynamically, for example from configuration or a database.IOutputCachePolicy?policy=ResolvePolicy(policyName);
returnValueTask.FromResult(policy);
}
}
```
Register the custom provider in dependency injection after calling `AddOutputCache`:
```csharpbuilder.Services.AddOutputCache();
builder.Services.AddTransient<IOutputCachePolicyProvider, TenantOutputCachePolicyProvider>();
```
The built-in provider continues to use policies configured with `OutputCacheOptions.AddPolicy` and `AddBasePolicy`. Replace it only when named or base policies must be resolved outside the static options configuration.
:::moniker-end
:::moniker range=">= aspnetcore-8.0"
## Work with the default output caching policy
Rationale: The policy-selection seam belongs next to the existing policy configuration section, where a reader is already deciding between base policies, named policies, and custom policy implementations. The text is scoped to >= aspnetcore-11.0 because the interface is new in .NET 11; the surrounding output caching content remains available for >= aspnetcore-8.0.
✅ 2. Update — TOC
No TOC change required. The edit adds a subsection to an article that already has a TOC entry; no new article is proposed.
✅ Action plan
Confirm the coverage status summary — especially that existing IOutputCachePolicy and OutputCacheOptions policy coverage doesn't already cover provider replacement.
Apply change 1 as a State D four-directive split. Verify moniker balance: 3 :::moniker range= openers and 3 :::moniker-end closers in output.md, with the reopened >= aspnetcore-8.0 range copied character-for-character.
Verify the <xref:Microsoft.AspNetCore.OutputCaching.IOutputCachePolicyProvider> reference resolves after API docs publish for .NET 11.
Build and confirm the new section renders only under the .NET 11 selector and does not appear under .NET 7–10.
Resolve any OpenPublishing.Build warnings.
⚠️ Review considerations
🟣 Concrete sample shape. Product source verifies the interface and DI replacement seam, but the proposed TenantOutputCachePolicyProvider is illustrative. A product-team reviewer should decide whether to include a full compiling sample or keep the section conceptual until API docs for IOutputCachePolicyProvider publish.
False-positive search result excluded:security/authorization/custom-authorization-policy-providers.md covers IAuthorizationPolicyProvider, not output caching. It shouldn't be linked from this issue.
Note
This is an AI-assisted coverage analysis generated by wadepickett
Target repository:
dotnet/AspNetCore.DocsAnalyzed at commit:
4986136881f2bbf1879f10106467769df5a49932Product source verified at:
dotnet/aspnetcore@1fcd7ef305697a1888f3ede076010350ae9f4f8dSource release note:
IOutputCachePolicyProviderinterface🎯 Goal
Tell a reader of the output caching article that .NET 11 exposes
IOutputCachePolicyProvideras the policy-resolution seam behind output caching. The article already explains built-in named policies, base policies, and customIOutputCachePolicyimplementations; this report closes the residual gap for dynamic policy providers that load policies from external configuration, databases, or tenant-specific sources.Gaps this report closes:
IOutputCachePolicyProviderinterface or its two members.✅ Coverage status summary
Legend: ✅ already documented · ✏️ update needed · 🟣 could not determine
IOutputCachePolicyProvideris a new public output-caching policy provider interfaceperformance/caching/output.mdL73–L79GetBasePolicies()returns the base policies to apply to requestsGetPolicyAsync(string policyName)resolves named policies dynamicallyOutputCacheOptions.AddPolicyandAddBasePolicystill configure the default providerperformance/caching/output.mdL55–L77 and product sourceOutputCacheOptions.csL39–L104IOutputCachePolicyimplementations can still be authored and selectedperformance/caching/output.mdL92–L127🔢 Version applicability
Applies to:
CURRENT-ONLYTarget moniker:
>= aspnetcore-11.0Earlier versions affected: None —
IOutputCachePolicyProvideris inPublicAPI.Unshipped.txtfor .NET 11, whileIOutputCachePolicyand theOutputCacheOptionspolicy methods were already shipped.monikerRangeperformance/caching/output.md'>= aspnetcore-7.0'>= aspnetcore-8.0body zone (L18–L262). Add the provider section by closing>= aspnetcore-8.0, opening>= aspnetcore-11.0, adding the content, closing it, and reopening>= aspnetcore-8.0. The included .NET 7 article (performance/caching/output/includes/output7.md) remains unchanged.The article has no tab groups, so the moniker split carries no tab-nesting hazard. After the change,
output.mdshould have 3:::moniker range=openers and 3:::moniker-endclosers; the reopened>= aspnetcore-8.0range must be copied exactly.📋 Coverage gap summary
A developer reading
performance/caching/output.mdcan learn how to define named policies and base policies inOutputCacheOptions, and can author customIOutputCachePolicyclasses. They can't learn the new .NET 11 seam that controls where those policies come from:IOutputCachePolicyProvider. That matters for the scenarios named in the release note — external configuration, databases, and tenant-specific policy rules — because those scenarios don't fit staticAddPolicycalls inProgram.cs.Feature announced in What's New:
Product source confirms the new seam:
AddOutputCacheregistersDefaultOutputCachePolicyProviderasIOutputCachePolicyProvider, the middleware asks the provider for base policies, and named policies resolve through the provider at request time.Breaking change: No — new public interface with the existing options-based behavior preserved by the default provider.
📁 Affected files
performance/caching/output.mdTarget article uids:
performance/caching/output📝 Proposed changes
✏️ 1. Update —
performance/caching/output.md, split the moniker zone and insert after line 77Applies to:
>= aspnetcore-11.0Location: Lines 73–79, immediately after the paragraph beginning "For Razor Pages apps" and before
## Work with the default output caching policy.Before (lines 73–79):
After:
Rationale: The policy-selection seam belongs next to the existing policy configuration section, where a reader is already deciding between base policies, named policies, and custom policy implementations. The text is scoped to
>= aspnetcore-11.0because the interface is new in .NET 11; the surrounding output caching content remains available for>= aspnetcore-8.0.✅ 2. Update — TOC
No TOC change required. The edit adds a subsection to an article that already has a TOC entry; no new article is proposed.
✅ Action plan
IOutputCachePolicyandOutputCacheOptionspolicy coverage doesn't already cover provider replacement.:::moniker range=openers and 3:::moniker-endclosers inoutput.md, with the reopened>= aspnetcore-8.0range copied character-for-character.<xref:Microsoft.AspNetCore.OutputCaching.IOutputCachePolicyProvider>reference resolves after API docs publish for .NET 11.TenantOutputCachePolicyProvideris illustrative. A product-team reviewer should decide whether to include a full compiling sample or keep the section conceptual until API docs forIOutputCachePolicyProviderpublish.security/authorization/custom-authorization-policy-providers.mdcoversIAuthorizationPolicyProvider, not output caching. It shouldn't be linked from this issue.🔗 References
IOutputCachePolicyProviderinterfaceperformance/caching/output.mdL55–L77 — named and base policies;performance/caching/output.mdL92–L127 — customIOutputCachePolicy.IOutputCachePolicyProvider.csL9–L22 — public interface and members.PublicAPI.Unshipped.txtL2–L4 — confirms the interface is new/unshipped for .NET 11.OutputCacheServiceCollectionExtensions.csL23–L31 — default provider registration.DefaultOutputCachePolicyProvider.csL8–L42 — default provider readsOutputCacheOptions.BasePoliciesandNamedPolicies.OutputCacheMiddleware.csL223–L245 — middleware asks the provider for base policies.NamedPolicy.csL62–L70 — named policies resolve throughIOutputCachePolicyProvider.GetPolicyAsync.