-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always decorate Symfonys config_cache_factory
service with WfdMetaConfigCacheFactory
(Case 171239)
#45
Always decorate Symfonys config_cache_factory
service with WfdMetaConfigCacheFactory
(Case 171239)
#45
Conversation
…d always The WfdMetaConfigCacheFactory creates a cache that checks its freshness by: 1. checking the "inner" cache with Symfony means 2. if that is still fresh, the WfdMetaConfigCache queries the wfd_meta table in regard to the registered wfdMeta-resources like a DoctrineEntityClassResource for a Page entity. Previously, the decoration only took place when `always_expire_wfd_meta_resources` was not set. This effectively disabled checking the wfdMeta-resources, at least in production environments. (The fact that one probably shouldn't use this configuration setting in production is another story.) This should not break anything, as the decoration used to happen always before the `always_expire_wfd_meta_resources` config setting was introduced in c7a2e2b.
"version = 3.9.0" seems slightly better than "3.14.0", as the deprecation was introduced (in another form) in 3.9.0 already.
/cc @mpdude |
👌🏻 |
Any particular reason why you did not squash-merge this, as we usually do? |
No. Just clicked the merge button, and I hadn't changed the default merge strategy for this repository, yet. (With your idea for a merge strategy, do I need to check the strategy each time before pressing the button? This one here should've been a squash merge, while #46 should have been (and was) a non-squash merge, right?) |
#45 broke the `always_expire_wfd_meta_resources` feature in a subtle way: The change made the `WfdMetaConfigCacheFactory` decorate the regular `config_cache_factory` service unconditionally. The idea was that the `CacheBustingResourceChecker` would then be added when setting `always_expire_wfd_meta_resources: true`, causing caches that rely on `wfd_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 Symfony `ConfigCacheFactory`), and the "extra" resources checked with `wfd_meta` data. `WfdMetaResources` would always end up in the second group, which is checked by `WfdMetaConfigCache`, and this check was not aware of `ResourceChecker`s at all. This rendered the `CacheBustingResourceChecker` 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 by `CacheBustingResourceChecker`. 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 the `isFresh()` check to that implementation first and then running a second round of checks.
The WfdMetaConfigCacheFactory creates a cache that checks its freshness by:
Before this PR, the decoration only took place when
always_expire_wfd_meta_resources
was not set. This effectively disabled checking the wfdMeta-resources, at least in production environments. (The fact that one probably shouldn't use this configuration setting in production is another story.)This PR configures the decoration independently of
always_expire_wfd_meta_resources
.This should not break anything, as the decoration used to be configured always before the
always_expire_wfd_meta_resources
config setting was introduced in c7a2e2b.Resolves #43.