Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.2k
Improve explanation of cache.app and cache.system#15827
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
base:4.4
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
cache.rst Outdated
The system cache ``cache.system`` is used for things like annotations, | ||
serializer, and validation. Usage is reserved for Symfony components | ||
and you should not use it for application cache needs. |
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.
The application can also use it if it has its own data derived from the source code that can be generated during cache-warmup.
The rules for usingcache.system
are:
- the cached content does not need to change if the source code of the app does not change (i.e. it does not need to change between deployments)
- the cached content has a CacheWarmer generating it (the
cache.adapter.system
is optimized for being read-only after the warm-up)
That's why it is used for the metadata of serializer and validation. But we could totally imagine applications that generate some metadata extracted from their source code (even though this is indeed more advanced use cases than the ones usingcache.app
.
On the other hand,cache.app
is independent from the deployment cycle of the source code (and generally needs to use a shared storage like Redis rather than the filesystem once you have multiple servers)
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.
@stof Thanks for commenting, I added your feedback to the PR.
95e1748
to7e73e82
Compare
This PR intends to clarify some things about cache.system and cache.app (#12774 among other things). Comments welcome of course :-)