aspnetcore/breaking-changes/7/output-caching-renames.md
Some APIs in the xref:Microsoft.AspNetCore.OutputCaching?displayProperty=fullName namespace have changed to better represent their intent.
The following APIs were removed:
OutputCachePolicyBuilder.#ctorOutputCachePolicyBuilder.ClearThe following APIs were renamed:
| Previous name | New name |
|---|---|
AllowLocking(System.Boolean) | xref:Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.SetLocking(System.Boolean) |
VaryByRouteValue(System.String[]) | xref:Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.SetVaryByRouteValue(System.String[]) |
VaryByQuery(System.String[]) | xref:Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.SetVaryByQuery(System.String[]) |
VaryByHeader(System.String[]) | xref:Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.SetVaryByHeader(System.String[]) |
The following APIs were added:
ASP.NET Core 7.0 RC 2
OutputCachePolicyBuilder.VaryByQuery(System.String[]) was additive: every call added more query string keys.
The OutputCachePolicyBuilder.VaryByQuery(System.String[]) method is now named xref:Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.SetVaryByQuery(System.String[])?displayProperty=nameWithType, and each call replaces existing query string keys.
For other changes, see the first section of this article.
This change affects source compatibility and binary compatibility.
This change was made to improve the consistency of method names and to remove ambiguity in their behavior.
Recompile any projects built with an earlier SDK. If you referenced any of these method names directly, update the source to reflect the new names.
Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.#ctorMicrosoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.ClearMicrosoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.AllowLocking(System.Boolean)Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.VaryByRouteValue(System.String[])Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.VaryByQuery(System.String[])Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.VaryByHeader(System.String[])