Update cache check#591
Merged
linglingye001 merged 1 commit intomainfrom Apr 16, 2026
Merged
Conversation
jimmyca15
approved these changes
Apr 15, 2026
230e8f2 to
de96c35
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this PR?
Problem
The
IFeatureDefinitionProviderCacheableinterface inIFeatureDefinitionProviderCacheable.csis internal, which prevents anyone implementing a customIFeatureDefinitionProviderfrom opting into the filter parameter binding cache — a performance optimization that avoids expensiveIConfiguration.Get<T>()calls on every evaluation. #367How the Caching Works Today
if (!(_featureDefinitionProvider is IFeatureDefinitionProviderCacheable) || Cache == null)If the provider does not implement the internal marker interface, filter parameter binding (the
binder.BindParameters(context.Parameters) call) runs on every evaluation — no caching. TheConfigurationWrapperclass enables cache invalidation by creating a new reference when configuration changes, socacheItem.Parameters != context.Parametersdetects staleness.Visible Changes
Update the cache check in
FeatureManagerto also recognizeConfigurationWrapper-based parameters, so wrappers aroundConfigurationFeatureDefinitionProviderautomatically get caching without any API changes. For fully custom providers, PR #589 is being worked on to let providers supplyFeatureDefinitionobjects directly (bypassing the configuration layer entirely), which would make the caching question moot.