-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[Cache] Enable namespace-based invalidation by prefixing keys with backend-native namespace separators #59813
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
ba82917 to
1e71a0c
Compare
|
If |
1e71a0c to
0ca7660
Compare
|
@stof you're totally right! I removed |
904427d to
349fa7b
Compare
|
Ready. Tests should be green after merge. |
b733583 to
80e4605
Compare
da4eacf to
b9b63de
Compare
…ckend-native namespace separators
b9b63de to
81a8ceb
Compare
|
PR ready (failures will be fixed by merging) |
|
Any comment @symfony/mergers ? |
kbond
left a comment
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.
❤️
|
thanks for this great feature @nicolas-grekas what type-hint that should we use in the constructor to have this ability with autowiring? or |
|
Can you try using an intersection type of both? That should work! |
|
i did (https://symfony-devs.slack.com/archives/C3EQ7S3MJ/p1748498675962069?thread_ts=1748446854.832469&cid=C3EQ7S3MJ) but it does not work [Symfony\Component\DependencyInjection\Exception\RuntimeException]
Cannot autowire service "App\Command\TestCommand": argument "$appCache" of method "__construct()" has type "Symfony\Contracts\Cache\CacheInterface&Symfony\Contracts\Cache\NamespacedPoolInterface" but this class
was not found. |
|
Can you open an issue? |
|
issue created #60583 |
This PR adds a
NamespacedPoolInterfacethat describes how one can add namespace prefixes to cache pool keys.This solves #45599 by allowing to use the
:separator for Redis:Most importantly, this enables namespace-based cache invalidation, typically with namespaces generated by hashing some context.