Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[FrameworkBundle] Add cache adapters in semantic configuration#18625
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| </service> | ||
| <serviceid="cache.pool.local"parent="cache.adapter.local"> | ||
| <serviceid="cache.pool.app"parent="cache.adapter.shared"> |
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.
@javiereguiluz WDYT about this one? We'd like to provide a preconfigured cache pool for user's need, so that one can inject it without much configuration. Currently we have two of these (cache.pool.local andcache.pool.shared).
The proposal here is to removecache.pool.local and renamecache.pool.shared tocache.pool.app.
Which means we have to questions:
- OK for removing the local pool and keep only the shared one?
- is the
cache.pool.appname OK or do we have a better idea (e.g. iscache.pool.userbetter)?
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.
At first glance, maybe this should be calledcache.pool.default I don't like the.app suffix because all the pools are for the app and because theapp. convention is commonly used as a prefix for user's stuff.
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.
But the pool we're talking about is only for user's stuff :)
nicolas-grekas commentedApr 25, 2016
👍 with a few more tests, must be on 3.1 or will be much harder to change afterwards. |
xabbuh commentedApr 25, 2016
We need to update the XML schema definition. |
55bfda8 todcbffa2Compare| <argument /><!-- default lifetime--> | ||
| </service> | ||
| <serviceid="cache.adapter.shared"alias="cache.adapter.filesystem" /> |
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 put the adapters here to follow the reading order (as in the configuration, the extension, etc.)
00986d1 to959bf64Comparenicolas-grekas commentedApr 28, 2016
…caches (tgalopin, nicolas-grekas)This PR was merged into the 3.1-dev branch.Discussion----------[FrameworkBundle] Semantic config for app/system/pool caches| Q | A| ------------- | ---| Branch? | 3.1| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#18625| License | MIT| Doc PR | -Commits-------a2a567d [FrameworkBundle] Simplify config for app/system/pool caches80a5508 [FrameworkBundle] Add cache adapters in semantic configuration
Uh oh!
There was an error while loading.Please reload this page.
Following other PRs about the integration of the Cache component into the FrameworkBundle, this PR proposes the possibility to define and overide adapters from the semantic configuration.
There are three main reasons why I think we should be able to configure adapters from the
config_*.ymlfiles:Here is an example of how we could configure every shared cache of the application to use redis instead of the filesystem with this proposal:
By default, the FrameworkBundle defines some useful adapters and pools. Using this proposal configuration, we can represent these adapters and pools like these:
And every adapter could be overriden by using the key
parentor by using the same name as the parent adapter (if you redefine theredisadapter to use a different provider, it will override the parent definition).This PR also removes the
localandsharedpool for a singleapppool. This is done to avoid confusion for users between the local/shared adapters and the local/shared pools and because app cache will almost always be shared.