Skip to content
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

Improve explanation of cache.app and cache.system #15827

Open
wants to merge 1 commit into
base: 4.4
Choose a base branch
from

Conversation

umulmrum
Copy link
Contributor

This PR intends to clarify some things about cache.system and cache.app (#12774 among other things). Comments welcome of course :-)

@umulmrum umulmrum changed the base branch from 5.4 to 4.4 September 17, 2021 14:56
@umulmrum umulmrum changed the title Improve explanation of cache.app and cache.system [Cache] Improve explanation of cache.app and cache.system Sep 20, 2021
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.
Copy link
Member

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 using cache.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 using cache.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)

Copy link
Contributor Author

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.

@umulmrum umulmrum force-pushed the system-and-app-cache branch from 95e1748 to 7e73e82 Compare September 21, 2021 09:14
@carsonbot carsonbot changed the title [Cache] Improve explanation of cache.app and cache.system Improve explanation of cache.app and cache.system Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants