OutputCachePolicyBuilder.VaryByQuery() was additive: every call would add more query string keys to vary by.
New behavior
OutputCachePolicyBuilder.SetVaryByQuery() is replacing existing query string keys.
Type of breaking change
[X] Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load/execute or different run-time behavior.
[X] Source incompatible: Source code may encounter a breaking change in behavior when targeting the new runtime/component/SDK, such as compile errors or different run-time behavior.
[ ] Behavioral change: Existing code and binaries may experience different run-time behavior.
Reason for change
This change was made to improve the consistency of method names and to remove ambiguity in their behavior.
Recommended action
It is recommended you recompile any projects built with an earlier SDK. If any of these method names were referenced directly, the source should be updated to reflect the new names.
Description
From 7.0 RC1 to 7.0 RC2 some APIs have changed to better represent their intent.
https://github.com/dotnet/aspnetcore/pull/43892
Version
.NET 7 RC2
Previous behavior
OutputCachePolicyBuilder.VaryByQuery()
was additive: every call would add more query string keys to vary by.New behavior
OutputCachePolicyBuilder.SetVaryByQuery()
is replacing existing query string keys.Type of breaking change
Reason for change
This change was made to improve the consistency of method names and to remove ambiguity in their behavior.
Recommended action
It is recommended you recompile any projects built with an earlier SDK. If any of these method names were referenced directly, the source should be updated to reflect the new names.
Affected APIs
Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.OutputCachePolicyBuilder()
Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.Clear()
Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.AllowLocking()
toSetLocking()
Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.VaryByRouteValue()
toSetVaryByRouteValue()
Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.VaryByQuery()
toSetVaryByQuery()
Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.VaryByHeader()
toSetVaryByHeader()
Microsoft.AspNetCore.OutputCaching.CacheVaryByRules.VaryByHost
Microsoft.AspNetCore.OutputCaching.OutputCacheOptions.AddPolicy(string name, Action<OutputCachePolicyBuilder> build, bool excludeDefaultPolicy)
Microsoft.AspNetCore.OutputCaching.OutputCacheOptions.AddBasePolicy(Action<OutputCachePolicyBuilder> build, bool excludeDefaultPolicy)
Microsoft.Extensions.DependencyInjection.OutputCacheConventionBuilderExtensions.CacheOutput<TBuilder>(this TBuilder builder, Action<OutputCachePolicyBuilder> policy, bool excludeDefaultPolicy)