-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Add router.ignore_cache
config option
#53059
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
Conversation
router.ignore_cache
config option
a77c708
to
798b131
Compare
798b131
to
af9127f
Compare
This PR was merged into the 7.1 branch. Discussion ---------- [FrameworkBundle] Update `cache_dir` config Update the documentation on configuration of the FrameworkBundle to reflect the deprecation of `cache_dir` (done in symfony/symfony#52962) and the introduction of `ignore_cache` (from symfony/symfony#53059). Fixes #19281 Ping `@alexandre`-daubois Commits ------- 47e0be0 [FrameworkBundle] Update cache_dir config
86fb594
to
88a7ef4
Compare
@nicolas-grekas I accidentaly merged symfony/symfony-docs#19399 Shall I revert or is PR ready to merge from your side? Thanks cc @xabbuh |
88a7ef4
to
1b9df2c
Compare
Signed-off-by: Quentin Devos <4972091+Okhoshi@users.noreply.github.com>
1b9df2c
to
7d538db
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would anyone want to disable the router cache?
@@ -13,6 +13,7 @@ CHANGELOG | |||
* Add `secrets:reveal` command | |||
* Add `rate_limiter` option to `http_client.default_options` and `http_client.scoped_clients` | |||
* Attach the workflow's configuration to the `workflow` tag | |||
* Add `router.ignore_cache` config option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no_cache?
@@ -619,8 +619,9 @@ private function addRouterSection(ArrayNodeDefinition $rootNode): void | |||
->scalarNode('type')->end() | |||
->scalarNode('cache_dir') | |||
->defaultValue('%kernel.build_dir%') | |||
->setDeprecated('symfony/framework-bundle', '7.1', 'Setting the "%path%.%node%" configuration option is deprecated. It will be removed in version 8.0.') | |||
->setDeprecated('symfony/framework-bundle', '7.1', 'Setting the "%path%.%node%" configuration option is deprecated. It will be removed in version 8.0. Please use the "ignore_cache" option if you want to ignore the cache in the router.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
->setDeprecated('symfony/framework-bundle', '7.1', 'Setting the "%path%.%node%" configuration option is deprecated. It will be removed in version 8.0. Please use the "ignore_cache" option if you want to ignore the cache in the router.') | |
->setDeprecated('symfony/framework-bundle', '7.1', 'Setting the "%path%.%node%" configuration option is deprecated. It will be removed in version 8.0. Use the "no_cache" option if you want to disable the router cache.') |
I don't know, but it was a supported scenario until cache option was deprecated. If you think it is not useful, I can also deprecate that feature as well. |
It is already deprecated, isn't it? I'm calling for use cases that need to disable the cache. We can merge this PR in a later version if people report that they cannot work around the deprecation while they need to disable the cache. |
Then I'll remove the part regarding this option in the doc. Should I close this PR now ? I can still reopen it or redo the code changes if needed in the future. |
Yep, let's close and wait for feedbacks. |
…ache` option (Okhoshi) This PR was merged into the 7.1 branch. Discussion ---------- [FrameworkBundle] Remove mention of inexistant `ignore_cache` option The `ignore_cache` option was introduced in the documentation in #19399, but was not introduced in the code and will not be in the 7.1 release (see symfony/symfony#53059 for more details). Commits ------- f68defc [FrameworkBundle] Remove mention of inexistant `ignore_cache` option
👋🏼 It's me, I want to disable the cache and I added the initial support for this configuration setting (explicitly mentioning the The reason is that I have test suites where different sets of routes need to be loaded. IIRC, the router keeps the routes in a What can I do to keep this possibility open? |
In #52962, the
router.cache_dir
is marked as deprecated, but no replacement was given for the specific case when one wants to completely disable the router cache (use to be done by settingrouter.cache_dir
to~
ornull
).This MR introduces
router.ignore_cache
option to restore that possibility, while still deprecating the choice of cache location.