10000 [Cache] Allow colon in key key (with redis at least) · Issue #45599 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Cache] Allow colon in key key (with redis at least) #45599
Closed
@lyrixx

Description

@lyrixx

Description

I noticed something strange with symfony cache. It forbids to use a colon : in the key name.

But, namespacing keys with redis is (was?) a best practice, and so we lose some power when using redis insight for example.

In insight, I can profile redis, and it shows me what keys I use the most by grouping keys by pattern (a:b:c:*)

image

As you can see, the "TOP KEY PATTERNS" is poorly detailed.

  1. Redis recommends to namespace key with a colon
  2. Redis insight uses this pattern to analyze keys and group results
  3. Symfony forbit me to use a colon in the but
  4. And moreover, Symfony itself, in the very end does use a colon (between the app prefix seed and my key (f-yOWMrlsA:*on the screenshot)

So to me, we should simply remove this restriction

Note: psr restricts this usage

Key - [...] The following characters are reserved for future extensions and MUST NOT be supported by implementing libraries: {}()/@:

But I don't use PSR, And I personally don't care about this PSR since I'm using Symfony contracts.

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0