Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.2k
[Cache] Improve the docs about cache namespaces#20966
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
ec396c3
intosymfony:7.3Uh oh!
There was an error while loading.Please reload this page.
You can even combine cache namespaces with :ref:`cache tags <cache-using-cache-tags>` | ||
for more advanced needs. | ||
There is no built-in way to invalidate caches by namespace. Instead, the recommended |
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.
Couldn't this be achieved with$cache->withSubNamespace('ns')->clear()
?
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.
It depends on the implementation: some support this, others not (they might return false or clear the full pool depending on the implementation.)
Not all backends support clearing by prefix...
Uh oh!
There was an error while loading.Please reload this page.
After talking with@nicolas-grekas about this, I think we should improve the recent docs about cache namespaces with more details like invalidation, a bit more context about when to use this, etc.