-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] Enable optional cache-warmers when cache-dir != build-dir #57553
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
0b0a8fa
to
8eadd68
Compare
Your second approach seems better to achieve what was missing 👍 |
$cacheWarmer->enableOptionalWarmers(); | ||
} | ||
|
||
$preload = array_merge($preload, (array) $cacheWarmer->warmUp($buildDir, $buildDir)); |
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 passing the buildDir twice ?
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.
because passing the cacheDir is highly confusing (which one should I use?), and warmers don't need to know where the cache-dir is when there is a build-dir (but they need to know they're running for the buildDir, so the argument needs to be passed, thus 2)
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.
I've reverted this part: passing the cacheDir actually forces warmers to opt-in for the build dir if they really want to support it
this is safer: not updated cache warmer will continue writing to the cache dir
This PR was merged into the 7.1 branch. Discussion ---------- [FrameworkBundle] Fix warming up routes | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT Follows #52962 and builds on the semantics of #57553. Commits ------- cc918e9 [FrameworkBundle] Fix warming up routes
8eadd68
to
7aa625b
Compare
We should be running optional cache warmers during kernel compilation when cache-dir != build-dir. This gives them an opportunity to run, which is missing right now.