-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Don't populate fallback cache on warmup #28331
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
138506e
to
c857ba5
Compare
|
||
foreach ($values as $k => $v) { | ||
$item = $this->fallbackPool->getItem($k); | ||
$this->fallbackPool->saveDeferred($item->set($v)); |
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.
this is the main call that I propose to remove in this PR (the rest is just collateral)
Note that this means ppl that have OPcache disabled won't have a warm cache.
But we don't care IMHO. |
I don't fully understand this proposal, so I'd like to ask you about it with a real example. If I browse some pages of Symfony Demo app in So, would this PR remove most (all?) of those files in |
One of these pools is the fallback annotations cache. After this change, this folder would end up with a lot less files. |
I agree that not having a warmed up cache for people not having OPCache is something we don't care about. People disabling OPCache in prod cannot complain to us about the app being slower due to having cache misses (it is also a lot slower due to not optimizing PHP anyway). |
Thank you @nicolas-grekas. |
…mup (nicolas-grekas) This PR was merged into the 4.2-dev branch. Discussion ---------- [FrameworkBundle] Don't populate fallback cache on warmup | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Since we populate the front PhpArrayCache, there is no need to also populate its fallback pool, since it will never be hit for the warmed up values. This saves creating a myriad of small cache files and some MB. Commits ------- c857ba5 [FrameworkBundle] Don't populate fallback cache on warmup
Won't this mean there is no cache available for console commands? |
This PR was merged into the main branch. Discussion ---------- Remove fallback cache on cache warmer Since Symfony 4.2 fallback cache on cache warmer is not supported anymore. Here's the PR that dropped it: symfony/symfony#28331 Commits ------- f3836d1 Remove fallback cache on cache warmer
Since we populate the front PhpArrayCache, there is no need to also populate its fallback pool, since it will never be hit for the warmed up values.
This saves creating a myriad of small cache files and some MB.