-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[Cache] Custom pool namespaces #12527
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
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 the PR. What's the use case you have that requires you to take over the namespace? The linked issue concluded that this was not needed there actually, so what's different for you?
@nicolas-grekas in our project we have API implemented with Symfony and Admin site with legacy Yii framework. So now if Symfony application creates cache items, say in Redis - then the other app cannot have the access to that item. In my case Admin site cannot invalidate the cache that was created by Symfony. So the solution is to make namespace more explicit, so to say. |
cache.rst
Outdated
@@ -269,6 +269,44 @@ keys with a namespace that's generated by hashing the name of the pool, the name | |||
of the compiled container class and a :ref:`configurable seed<reference-cache-prefix-seed>` | |||
that defaults to the project directory. | |||
|
|||
If you, for some reason, want to take control over pool namespace generation, |
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.
What about this, to better explain when this is useful?:
If you need the namespace to be interoperable with a third-party app, you can take control over auto-generation by setting the [...]
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, thats much better, indeed :)
56c2f9f
to
f437edc
Compare
f437edc
to
526012e
Compare
Hi @henry2778! I'm sorry for the long wait (Exactly 1 year!). I just merged this PR and made a few minor changes while doing so (moved it a bit further down and into a "tip" box). Thank you for submitting this PR! |
Hi everyone. I suggest adding this small paragraph in the Cache docs. This is about controlling the namespace of the pool. Related PR: symfony/symfony#26743. I spent some time figuring this out, so maybe it will be useful for other devs. Thanks!