Skip to content
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

Keep WfdMetaResource instances in the regular metadata file #47

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

mpdude
Copy link
Member

@mpdude mpdude commented Jul 1, 2024

#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 ResourceCheckers 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.

@mpdude mpdude force-pushed the fix-cache-busting branch from 5ffabb6 to 2b50f0a Compare July 1, 2024 14:10
@mpdude mpdude changed the base branch from master to 3.19.x July 1, 2024 14:11
@MalteWunsch MalteWunsch changed the title Keep WfdMetaResource instances in the regular metadata file Keep WfdMetaResource instances in the regular metadata file (Case 172852) Jul 1, 2024
@mpdude mpdude merged commit 391e7ef into 3.19.x Jul 1, 2024
5 checks passed
@mpdude mpdude deleted the fix-cache-busting branch July 1, 2024 15:54
@mpdude mpdude changed the title Keep WfdMetaResource instances in the regular metadata file (Case 172852) Keep WfdMetaResource instances in the regular metadata file Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant