Keep WfdMetaResource
instances in the regular metadata file
#47
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.
#45 broke the
always_expire_wfd_meta_resources
feature in a subtle way:The change made the
WfdMetaConfigCacheFactory
decorate the regularconfig_cache_factory
service unconditionally. The idea was that theCacheBustingResourceChecker
would then be added when settingalways_expire_wfd_meta_resources: true
, causing caches that rely onwfd_meta
to be refreshed every time.What we missed was that
WfdMetaConfigCache
sorts the resources into two groups - those for the regular freshness check (which happens by means of the SymfonyConfigCacheFactory
), and the "extra" resources checked withwfd_meta
data.WfdMetaResources
would always end up in the second group, which is checked byWfdMetaConfigCache
, and this check was not aware ofResourceChecker
s at all. This rendered theCacheBustingResourceChecker
useless, since it was never applied to anything.This PR fixes the problem by keeping
WfdMetaResource
instances in the set of resources to be checked by the "inner" (regular) config cache factory, where they can be picked up byCacheBustingResourceChecker
.It also gives a bit more clarity to how the
WfdMetaConfigCache
actually works: It now behaves more cleanly like a decorator around the "inner"ConfigCache
instance, delegating theisFresh()
check to that implementation first and then running a second round of checks.