Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Cache] Allow to use namespace delimiter in cache key#51603
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
24881eb to94ec24fCompare| } | ||
| if (false !==strpbrk($key,self::RESERVED_CHARACTERS)) { | ||
| thrownewInvalidArgumentException(sprintf('Cache key "%s" contains reserved characters "%s".',$key,self::RESERVED_CHARACTERS)); | ||
| $reservedChars =null ===$allowChars ?self::RESERVED_CHARACTERS :str_replace(str_split($allowChars),'',self::RESERVED_CHARACTERS); |
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.
would it be possible to get rid of the calls to str_replace and str_split? this is on the hotpath and we'd better make this as fast as possible
| return$this->namespace.$this->namespaceVersion.$this->ids[$key]; | ||
| } | ||
| \assert('' !== CacheItem::validateKey($key)); | ||
| \assert('' !== CacheItem::validateKey($key,static::NS_SEPARATOR)); |
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.
this one is used for PSR-6 also, isn't it?
nicolas-grekas commentedNov 20, 2023
@vtsykun up to resume this PR? |
dorrogeray commentedJan 26, 2024
It would be great to have this feature 👍 I can try to pick up this PR@vtsykun if you are too busy. |
nicolas-grekas commentedApr 23, 2024
@dorrogeray follow up PR welcome then! |
dorrogeray commentedApr 23, 2024
@nicolas-grekas I will work on it this week. |
nicolas-grekas commentedFeb 19, 2025
Closing in favor of#59813, thanks for giving this a try! |
Uh oh!
There was an error while loading.Please reload this page.
This PR allow colon char
:in cache key. It may be useful for redis grouping keys by pattern without creating a many pools for each namespace.Difference between implementation#47561