Skip to content

Conversation

@mpdude
Copy link
Member

@mpdude mpdude commented Aug 30, 2024

The always_expire_wfd_meta_resources config setting can be used to make WfdMetaResource instances always expire immediately. It is supposed to be set in Symfony environments like test (e. g. in a config_test.yml file or a when@test section).

However, until now, it works correctly only for kernel.debug = true.

This is because it used a special CacheBustingResourceChecker that would be used by the "inner" (regular) ConfigCache instance only. That ResourceChecker would invalidate the cache when an instance of a WfdMetaResource is found.

The ConfigCache, however, contains a shortcut to never validate the cache in the first place when kernel.debug is disabled.

Thus, we need to move this behavior to the WfdMetaConfigCache, which will run its check also in non-debug mode. There, we want to consider the setting only in the case that there are actually WfdMetaResources associated with the cache in question.

Being able to disable kernel.debug mode for tests execution can provide a significant speed-up in environments where you don't actually modify code between test runs, i. e. a CI pipeline.

@mpdude mpdude force-pushed the expire-wfdmeta-also-non-debug branch from 48e8ea1 to 779a4dd Compare August 30, 2024 14:56
@mpdude mpdude merged commit ed0032c into master Sep 3, 2024
@mpdude mpdude deleted the expire-wfdmeta-also-non-debug branch September 3, 2024 15:55
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.

2 participants